[Webtest] GETs on hrefs in form when clickbutton

Glen Cordrey webtest@lists.canoo.com
Wed, 11 Feb 2004 08:51:29 -0500


I discovered the problem was pilot error - I had a verifylinks call that =
was causing the GETs.

-----Original Message-----
From: Glen Cordrey=20
Sent: Tuesday, February 10, 2004 1:02 PM
To: webtest@lists.canoo.com
Subject: [Webtest] GETs on hrefs in form when clickbutton


I have a <form that contains 1 field and many href's to Struts .do's, as =
shown
below (yes, there's no need for the href's to be inside the form, but =
that's how it is
and I can't change it). When I use clickbutton to submit the form (Ant =
snippet below)
Webtest first does GETs for each of the hrefs in the form, then does the =
POST. If I=20
exercise the form manually GETs for the hrefs aren't done, and when =
Webtest does
them failures result because the GETs seem to have thrown off the =
servlet's state.
So, a couple of questions:

 1. Is the Ant snippet correct, or should I be doing something =
different?
 2. Assuming I can't change the form, is there a way for me in Webtest =
to submit
     the form, via clickbutton or any other mechnism, without triggering =
the GETs that
     result from the hrefs?


<!-- example of form containing hrefs -->

  <form name=3D"myForm"  id=3D"queryForm"
    action=3D"execQuery.do" method=3D"POST">
...
      <a href=3D"someAction.do" ... >
...
      <!-- actual form field and image button -->
      <input name=3D"queryString" type=3D"text" size=3D"48" value=3D"" =
testID=3D"input_queryString"/>
      <input type=3D"image" name=3D"myButton" id=3D"imgSearch"=20
                   src=3D"images/local/btn_search.gif" =
testID=3D"input_image_submitSearch" alt=3D"search" >
..
     < href=3D"anotherAction.do" ...?
  </form>


Ant snippet submitting the form:

 <setinputfield
     stepid=3D"Submit search form"
     name=3D"queryString"
     value=3D"congress" />
  <clickbutton stepid=3D"exec query" name=3D"myButton">
               <form name=3D"myForm" />
    </clickbutton>



Glen Cordrey                 Convera             =20
voice: (410) 740-8800 x1150  http://www.convera.com
fax:    (410) 740-8810