[Webtest] Newbie forms submission question

Petter Måhlén webtest@lists.canoo.com
Fri, 31 Mar 2006 09:48:27 +0200


Hi,

That worked perfectly, thanks! Webtest is looking better and better, both in
terms of features and community. :)

/ Petter 

> -----Original Message-----
> From: webtest-admin@lists.canoo.com 
> [mailto:webtest-admin@lists.canoo.com] On Behalf Of Marc Guillemot
> Sent: Thursday, March 30, 2006 12:13 PM
> To: webtest@lists.canoo.com
> Subject: Re: [Webtest] Newbie forms submission question
> 
> 
> Hi Petter,
> 
> not bad for a newbie question ;-)
> 
> The <scriptStep/> allows to script ant and webtest, not to 
> execute a script
> in the currently loaded page. This would be a nice (and 
> already discussed)
> improvement but doesn't exist yet.
> <setInputField/> doesn't allow to set an hidden field as it 
> woulnd't allow
> to detect that a user can't set a field when it is 
> erroneously hidden. For
> this purpose you can use emulateSetHiddenInputField [1].
> 
> Your example with <invoke/>wouldn't work as an invoke - as 
> its name states -
> performs a fresh invocation, without taking care of what may be in the
> current page. 
> 
> One solution would be to add the query parameters and their 
> values your
> invoke. The other solution would be to make by hand the form 
> submission with
> a script step like (check the API of Webtest if it doesn't 
> work, I write it
> without verifying it):
> <groovy>
> step.context.currentResponse.getFormByName('loginForm').submit()
> </groovy>
> This second solution is surely better because your closer to 
> what is done in
> the page by a normal user.
> 
> Marc.
> 
> [1] 
> http://webtest.canoo.com/webtest/manual/emulateSetHiddenInputF
> ield.html
> --
> View this message in context: 
> http://www.nabble.com/Newbie-forms-submission-question-t136739
> 2.html#a3667442
> Sent from the WebTest forum at Nabble.com.
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> 
>