Antwort: Re: [Webtest] clicklink and clickbutton-no new response ...

Werner Koenig
Tue, 20 Jul 2004 14:26:03 +0200

ok, I think you are right in some way:

In a very easy example (also with some javascript in it) it runs well -=20
clicklink and performing setinputfield and clickbutton

<script type=3D"text/javascript" language=3D"Javascript1.1">=20

    function validate(form) {=20
    if (form.mytext.value=3D=3D'') {
        alert("fill it, please");
        return false;
    else  {
      return true;=20
<form action=3D"./log4j.jsp" name=3D"myform"
        onsubmit=3D"return validate(document.myform);">
        <INPUT type=3D"text" name=3D"mytext" value=3D"" />
        <INPUT type=3D"submit" value=3D"mybutton" /></form>
<p><a href=3D"./menus.jsp">mylink</a></p>

We are using some very complex javacript-validations berfore submitting a=20
form (you know Struts?).
But I am sure, the javascript-code does not cancel the submit.
I tried the complex example with submit-cancelling input - and the submit=20
is not performed.

so I think:

easy submits and links run well, complex javascript cancels the request.

the two fixes are able to deal with complex javascript ....

am I right???

Freundliche Gr=FC=DFe

Werner K=F6nig

>May you have some javascript in the page? Calling
"simulates" a click on the link and triggers for instance=20
>the onclick javascript code which can cancel the navigation to the url=20
specified in the href. Else I know that httpunit=20
>handles targets quite bad. In all cases, if you can build a very small=20
sample script+html page illustrating the problem,=20
>I'm interested in (the smallest possible is the best, really with minimal =

html code).

Werner Koenig wrote:
> Hallo,
> when performing a click on a link or a button (see the following xml - I =

> don't think it is wrong !?) id does not work: no new request is coming=20
> from the server.
> In Server-debug-mode I did not see an incoming request.
> <clicklink stepid=3D"Detailinfo" label=3D"Dr">
>  or
> <setinputfield name=3D"nname" value=3D"aName" />
> <clickbutton stepid=3D"submit masuche"
>         label=3D" Suche starten ">
> <form name=3D"mitarbeitersuche" />
> </clickbutton>
>  I changed the code submitting the request in=20
> gotoTarget(...) {...
>   WebRequest req =3D form.getRequest((SubmitButton)button);
>   // original:=20
> setIntermediateResponse(context.getWebConversation().getCurrentPage());
> setIntermediateResponse(context.getWebConversation().getResponse(req));
> ...}
> and in ClickLink:
>  doExecute(...) {...
>                         prepareConversation(context);
>                       ;
>                                 WebConversation wc =3D=20
> context.getWebConversation();
>                                 wc.sendRequest(theLink.getRequest());
>                                 WebResponse resp =3D wc.getCurrentPage();
> ...}
> before it was only         WebResponse resp =3D;=20
> and now it works !?!?
> some ideas?
> Many thanks!
> Werner=20
> =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
> WebTest mailing list

WebTest mailing list