Hi, HtmlUnit (and as a result JWebUnit) doesn't download images by default (this is a headless browser). You can try solutions proposed here:
http://stackoverflow.com/questions/2244272/how-can-i-tell-htmlunits-webclient-to-download-images-and-css Or simply try URL url = new URL(baseUrl + "AuthImage.do"); url.getContent(); Regards, Julien >________________________________ > De : 李麒慶 <e47...@gmail.com> >À : jwebunit-users@lists.sourceforge.net >Envoyé le : Samedi 4 août 2012 5h22 >Objet : [JWebUnit-users] jwebunit cannot run servlet? > > > I am try to test a page for Registration >Here is some part of the registration.jsp code: > > ><label><span class="text" style="font-size:24px;"><img border=0 >src="AuthImage.do" alt=""/></span></label></td> > > >AuthImage.do is the java source code ,it generates Verification code and >return an image to the registration.jsp, user then >types the number for what they see in the image. > > >However, when I use JWebunit to test, it seems not automatically >run AuthImage.do to generate image. >Is JWebunit doesn't support this unless we use such like (<form >name="registerform" action=" AuthImage .do" method="post">)? >But the AuthImage.do needs load before user submit the form,so is there any >solution for this? > > >Thank you for your advice. >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >JWebUnit-users mailing list >JWebUnit-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ JWebUnit-users mailing list JWebUnit-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jwebunit-users