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

Marc Guillemot webtest@lists.canoo.com
Tue, 20 Jul 2004 14:41:41 +0200


I guess that you're wrong.
Indeed it seems to be one time again an effect of the buffering "feature" of the setXXX steps. Read attentively the doc 
if you really want to continue using the setXXX steps or have a look at the new_setXXX steps and it should work.

Marc.

PS: yes I know struts
PS2: you can write <form action="./log4j.jsp" name="myform" onsubmit="return validate(this)">, it's shorter and the js 
won't fail when your rename your form.

Werner Koenig wrote:
> ok, I think you are right in some way:
> 
> In a very easy example (also with some javascript in it) it runs well - 
> clicklink and performing setinputfield and clickbutton
> 
> <html>
> <head>
> <TITLE>XX</TITLE>
> <script type="text/javascript" language="Javascript1.1"> 
> 
>     function validate(form) { 
>     if (form.mytext.value=='') {
>         alert("fill it, please");
>         return false;
>     }
>     else  {
>       return true; 
>     } 
>    } 
> </script>
> </head>
> <body>
> <form action="./log4j.jsp" name="myform"
>         onsubmit="return validate(document.myform);">
>         <INPUT type="text" name="mytext" value="" />
>         <INPUT type="submit" value="mybutton" /></form>
> <p><a href="./menus.jsp">mylink</a></p>
> </body>
> </html>
> 
> We are using some very complex javacript-validations berfore submitting a 
> 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 
> 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üße
> 
> Werner König
> 
> 
> 
> 
> 
> 
>>May you have some javascript in the page? Calling link.click() 
> 
> "simulates" a click on the link and triggers for instance 
> 
>>the onclick javascript code which can cancel the navigation to the url 
> 
> specified in the href. Else I know that httpunit 
> 
>>handles targets quite bad. In all cases, if you can build a very small 
> 
> sample script+html page illustrating the problem, 
> 
>>I'm interested in (the smallest possible is the best, really with minimal 
> 
> html code).
> 
>>Marc.
> 
> 
> 
> 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 
>>from the server.
>>In Server-debug-mode I did not see an incoming request.
>>
>><clicklink stepid="Detailinfo" label="Dr">
>> or
>><setinputfield name="nname" value="aName" />
>><clickbutton stepid="submit masuche"
>>        label=" Suche starten ">
>><form name="mitarbeitersuche" />
>></clickbutton>
>> I changed the code submitting the request in 
> 
> com.canoo.webtest.steps.request.ClickButton.java:
> 
>>gotoTarget(...) {...
>>  WebRequest req = form.getRequest((SubmitButton)button);
>>  // original: 
>>setIntermediateResponse(context.getWebConversation().getCurrentPage());
>>setIntermediateResponse(context.getWebConversation().getResponse(req));
>>...}
>>
>>and in ClickLink:
>> doExecute(...) {...
>>                        prepareConversation(context);
>>                                theLink.click();
>>                                WebConversation wc = 
>>context.getWebConversation();
>>                                wc.sendRequest(theLink.getRequest());
>>                                WebResponse resp = wc.getCurrentPage();
>>...}
>>
>>before it was only         WebResponse resp = theLink.click(); 
>>
>>and now it works !?!?
>>
>>some ideas?
>>
>>Many thanks!
>>
>>
>>Werner 
>>_______________________________________________
>>WebTest mailing list
>>WebTest@lists.canoo.com
>>http://lists.canoo.com/mailman/listinfo/webtest
>>
> 
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>