[Webtest] Problem to submit form with <BUTTON>
Xavier MOGHRABI
webtest@lists.canoo.com
Tue, 12 Oct 2004 18:44:54 +0200
Thanks for answering me, here my comments :
Le mardi 12 Octobre 2004 13:55, dierk.koenig@gate2.canoo.com a =E9crit=A0:
> Hi Xavier,
Hi Mittie
> For clicking on Buttons, WebTest relies on an
> HttpUnit functionality "form.getSubmitButtons()".
> This may be defect in the version we use (1.5.4).
Yes, I had a watch in the source file and I can tell you that you need the=
=20
latest version of HttpUnit (1.6).
In fact it doesn't work when we use form with <BUTTON> tags that don't have=
a=20
name or a value like this : <BUTTON type=3D"submit">Post</BUTTON> (tested o=
n=20
the site www.theserverside.com for login). When there is a name or/and valu=
e,=20
it should works (not tested).
In fact when you use a <BUTTON type=3D"submit">Post</BUTTON>, the methods :=
=20
Button.getName() and Button.getValue() return an empty String. So with=20
HttpUnit 1.6 there is new methods : Button.getText() and Button.getType()
for the last example :
Button.getText() returns "Post"
Button.getType returns "submit"
So we'll have to play with that to success to locate the button.
I've migrated Cannoo to HttpUnit without apparing problems
(the constructor of WebResponse has change, changing HttpUnit produce 2 err=
ors=20
which I've corrected : replace "new WebResponse(WebClient client,=20
java.lang.String frameName, java.net.URL url)" by "new WebResponse(WebClie=
nt=20
client, FrameSelector frame, java.net.URL url)". So frameName=3D"" should b=
y=20
converted by null)
So my idea was to add attributes to clickbutton like this :
clickbutton :
type : reffering to the button type (reset, submit)
text : reffering to the text between <Button..>TEXT</Button>
I'm inquiring to understand who can I add this. I'm not really familiar wit=
h=20
Ant for launching application. So I try to understand where it begins.
Bye
> The issue is likely to be solved with the move that
> we are currently going though as the underlying
> execution engine is concerned.
>
> I will add a testcase asap (possibly friday) but
> defer further investigation until our move is
> completed.
>
> cheers
> Mittie
>
> -------- Original Message --------
>
>
> From: xavier.moghrabi@inrialpes.fr
> Sent: Tue Oct 12 10:02:43 CEST 2004
> To: webtest@gate2.canoo.com
> CC:
> Subject: [Webtest] Problem to submit form with <BUTTON>
>
> Hello,
>
> I recently focus on Canoo Webtest. I've done some tests and I didn't
> success to use clickbutton on the tags <button>.
>
> For example, i've got a form like this following one :
>
> FORM action=3D"http://somesite.com/prog/adduser" method=3D"post">
> First name: <INPUT type=3D"text" name=3D"firstname"><BR>
> Last name: <INPUT type=3D"text" name=3D"lastname"><BR>
> email: <INPUT type=3D"text" name=3D"email"><BR>
> <INPUT type=3D"radio" name=3D"sex" value=3D"Male"> Male<BR>
> <INPUT type=3D"radio" name=3D"sex" value=3D"Female"> Female<BR>
> <BUTTON name=3D"submit" value=3D"submit" type=3D"submit">
> Send<IMG src=3D"/icons/wow.gif" alt=3D"wow"></BUTTON>
> <BUTTON name=3D"reset" type=3D"reset">
> Reset<IMG src=3D"/icons/oops.gif" alt=3D"oops"></BUTTON>
> </FORM>
>
> Does anybody know how can I submit the form with Canoo Webtest ?
>
> Indeed clikbutton submits only on tag like <INPUT type=3D"submit" .../> or
> <INPUT type=3D"image" .../>. However the tag <BUTTON> can be use instead =
and
> it's compliant HTML 4.01
>
> Thanks for your further answers.
>
> --
> Xavier MOGHRABI - Consortium ObjectWeb
> Email : xavier.moghrabi at inrialpes.fr
> Phone : +33 4 76 61 55 25
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>
> ---------------- End of Message -----------------
>
>
> -------- Original Message --------
>
>
> From: xavier.moghrabi@inrialpes.fr
> Sent: Tue Oct 12 10:02:43 CEST 2004
> To: webtest@gate2.canoo.com
> CC:
> Subject: [Webtest] Problem to submit form with <BUTTON>
>
> Hello,
>
> I recently focus on Canoo Webtest. I've done some tests and I didn't
> success to use clickbutton on the tags <button>.
>
> For example, i've got a form like this following one :
>
> FORM action=3D"http://somesite.com/prog/adduser" method=3D"post">
> First name: <INPUT type=3D"text" name=3D"firstname"><BR>
> Last name: <INPUT type=3D"text" name=3D"lastname"><BR>
> email: <INPUT type=3D"text" name=3D"email"><BR>
> <INPUT type=3D"radio" name=3D"sex" value=3D"Male"> Male<BR>
> <INPUT type=3D"radio" name=3D"sex" value=3D"Female"> Female<BR>
> <BUTTON name=3D"submit" value=3D"submit" type=3D"submit">
> Send<IMG src=3D"/icons/wow.gif" alt=3D"wow"></BUTTON>
> <BUTTON name=3D"reset" type=3D"reset">
> Reset<IMG src=3D"/icons/oops.gif" alt=3D"oops"></BUTTON>
> </FORM>
>
> Does anybody know how can I submit the form with Canoo Webtest ?
>
> Indeed clikbutton submits only on tag like <INPUT type=3D"submit" .../> or
> <INPUT type=3D"image" .../>. However the tag <BUTTON> can be use instead =
and
> it's compliant HTML 4.01
>
> Thanks for your further answers.
=2D-=20
Xavier MOGHRABI - Consortium ObjectWeb
Email : xavier.moghrabi at inrialpes.fr
Phone : +33 4 76 61 55 25