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