[Webtest] Newbie forms submission question

Petter Måhlén webtest@lists.canoo.com
Thu, 30 Mar 2006 15:19:19 +0200


Hi,

Thanks for the response - I had missed that one, but it looks like it's what
I was looking for. That will surely be useful for some of the web pages I'll
be developing test for. 

Unfortunately, I don't think that approach works in this case, because the
next step, when I try to submit the form using <invoke/> (I modified the
setInputField source to see what happened), I get an error because <invoke
method="POST" /> requires one of (content, contentFile) to be specified. So
instead, I am now using:

<invoke method="POST" content="email=3Dtest@test.com&amp;password=test"
url="url" />

This works, and I should be able to use properties instead of the hard-coded
values I have there now. However, I also tried using the contentFile way of
specifying POST content, and that didn't work out. I used the following file
contents:

BEGIN FILE
email=3Dtest@test.com&password=test
END FILE

If I had a trailing 'end-of-line' after the password, that got tacked on to
the password parameter, which meant that authentication failed. If I didn't
have a trailing end-of-line, the password parameter wasn't even seen by the
server application - the only request parameter it detected was 'email'. I
got it to work using the following file:

BEGIN FILE
email=3Dtest@test.com&password=test&dummy=dontcare
END FILE

I guess that's a bug in Webtest or HtmlUnit somewhere, but I haven't been
able to pinpoint it. Should I submit this as a bug?

Best,

Petter

> -----Original Message-----
> From: webtest-admin@lists.canoo.com 
> [mailto:webtest-admin@lists.canoo.com] On Behalf Of Denis N. Antonioli
> Sent: Thursday, March 30, 2006 11:22 AM
> To: webtest@lists.canoo.com
> Subject: Re: [Webtest] Newbie forms submission question
> 
> Hi
> 
> On 30 mars 06, at 10:04, Petter Måhlén wrote:
> 
> > That also doesn't work, due to the fact that hidden input fields  
> > cannot be
> > set with <setInputField/>.
> 
> Have you tried the step emulateSetHiddenInputField  <http:// 
> webtest.canoo.com/webtest/manual/emulateSetHiddenInputField.html>?
> 
> That's without discussing the merit of your proposed change ;-)
> 
> 
> Best
> 	dna
> 
> -- 
> perl cannot be taught. It is an art form unto itself.
>    -- Jason Hoos
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> 
>