Re: [Http-webtest-general] button with input TYPE="button"
Brought to you by:
m_ilya,
richardanderson
From: Duncan C. <dca...@bc...> - 2003-02-15 08:20:11
|
On 2003-02-14 Eral TRMB wrote: >Hi, here is a form with two buttons I am trying to test with HTTP-WebTest >v2.00: > ><form METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" >NAME="theForm"> ><table align=center width=100% > ><tr> > <th ALIGN="right">TheForm Header</th> > <td><input TYPE="text" NAME="Thingname" VALUE="Good_name" SIZE=12 >MAXLENGTH=12></td> ></tr> ><tr> > <td ALIGN="right"><input TYPE="submit" NAME="okay" VALUE="Set Name"></td> > <td><input TYPE="button" NAME="cancel" VALUE="Cancel" >ONCLICK="document.location='../otherscript.cgi';"></td> ></tr> ></table> ></form> > > >I would like to test the cancel button with click_button after submitting a >bad name: > >plugins = ( "::Click" ) > >test_name = Cancel bad system name > url = mainscript.cgi # Returns the above form > click_button = Cancel > params = ( Thingname => Bad_name ) > text_require = ( Some text returned by otherscript.cgi ) >end_test > >Well, this test always fail because the answer I receive is as if I had >clicked on the "Set Name" button. > >Would there be a way to test the Cancel button? Is there anything I am doing >wrong? click_button applies only to 'submit' buttons on forms, not to other sorts of buttons. Maybe you could put that button in its own form as it has a separate navigation purpose to the submit button. >PS: It took me quite some time to figure out how to specify two plugins in >the same script. It seems that plugins( "::Plug1" "::Plug2" ) works, but it >would be nice to put it somewhere in the Cookbook. > That's how all list parameters are specified. Regards, Duncan Cameron |