From: Dave K. <dko...@ve...> - 2005-05-04 18:29:02
|
At 01:57 PM 5/4/2005, you wrote: >HtmlUnit doesn't load images at all. Is there something else that's broken? > >Brad C So that applies, by design, to both html and javascript? Does the image even get downloaded, or is it completely ignored? I've got javascript that's doing something along the likes of the following function xyz() { var x = new Image(); x.src = "http://perfserver:2000/sendmsg.cgi?param1=value1¶m2=value2; } This function is then called in the onload() and onunload() functions to communicate back to a server (other than the web server) data regarding the performance of rendering the page. This is a handy bit of functionality, since the setting of the src property causes the page to be fetched to the browser cache which, in this case, is sending encoded data to a server asynchronously. Since the Image variable is never displayed, you don't have to worry about hiding it in the page somewhere, and you don't really care what comes back from the URL (since it is intended to transmit data). If you are using HTMLUnit to do performance testing as well as functionality testing, then handling images is important, both the download and render phase, since they contribute significantly to the overall "load" time of a web page. Or do you not see HTMLUnit being used for performance testing at all? Dave |