Guys,

It seems that the net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog class is 
caching the 
form element when it's getForm() is called. This means that if you're 
navigating through a 
few pages, your form won't be resetted, and your previous form will be 
resubmitted? e.g.

beginAt("page1.action");
assertTextPresent("Page 1");
//        setWorkingForm("form1");
submit();

assertTextPresent("Page 2"); // we're now on page 2
//        setWorkingForm("form2");
submit(); // This will actually resubmit the form on the first page

Quite strange! We found the calling setWorkingForm will reset the form to the 
current 
correct one.

I'm guessing the reason the form is cached is that it's quite slow to retrieve? 
I'm not 
sure what the most fool-proof way of dealing with this issue, since many events 
(submit, 
clickLink) may trigger a new page and force the cached form to be cleared.

Maybe it'd be better if the form was not cached?

Cheers,

Mark C
-- 
-------------------------------------
ATLASSIAN - http://www.atlassian.com
Australia's Fastest Growing Software Company 2002-05 [BRW Magazine]


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to