[Webtest] the clicklink and clickbutton-problem again - with the newest release
Werner Koenig
webtest@lists.canoo.com
Wed, 21 Jul 2004 12:23:35 +0200
Hallo,
I have checked out the newest Release from CVS and tried it out. The=20
complex examples discussed in the threads above won't run, even with the=20
new setXXX-tags and classes.
So I don't think this is a problem with a "buffer-feature" (I don't know=20
what it is ;-)
So I think the submit of a form with complex validations will run with the =
small Patches I have shown !?
Also the link with the javascript - open window with this.href - is=20
running with the patches. Maybe you should try them out !?
Freundliche Gr=FC=DFe
Werner K=F6nig
> <html>
> <body>
> <p><a href=3D"./menus.jsp" onclick=3D"javascript:window.open(this.href);r=
eturn false;">mylink</a></p>
> </body>
> </html
such a link opens a new window and in this case it may seem quite natural=20
to have this window as the current one. But=20
what if for instance your js opens 2 windows? or opens a new window and=20
changes the current's frame content=20
simoultaneously? For such cases we would need additional steps like=20
"<selectwindow>" but as far as I can remember I=20
wasn't satisfied of the multiwindows handling of httpunit. When we will=20
use htmlunit perhaps...
Marc.
the Patches:
ClickButton.java in doExecute:
WebRequest req =3D form.getRequest((SubmitButton)button);
// original:=20
//setIntermediateResponse(context.getWebConversation().getCurrentPage());
setIntermediateResponse(context.getWebConversation().getResponse(req));
ClickLink:
protectedGoto(context, "link href=3D" + theLink.getURLString(), new Block()=
=20
{
public void call() throws Exception {
LOG.debug("Clicking on link with href: " +=20
theLink.getURLString());
prepareConversation(context);
//=20
// here the javascript is performed correct
theLink.click();
WebConversation wc =3D context.getWebConversation();
wc.sendRequest(theLink.getRequest());
WebResponse resp =3D wc.getCurrentPage();
setIntermediateResponse(resp);
}
});