[Webtest] Problem with WebRequest generated by ClickButton

Greg Vatman webtest@lists.canoo.com
Wed, 11 Aug 2004 11:10:11 -0700


This is a multi-part message in MIME format.

------_=_NextPart_001_01C47FCE.717EC80F
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I'm a WebTest newbie that just started using this application this week. =
 First, I'd like to say that this is a great and well designed product =
that will save me alot of trouble.  I was trying to find a way to =
further enhance and simplify my HttpUnit automation scripts for the =
other QA engineers in my group and I believe WebTest is the key.

Now, onto my problem.  I have a page with two forms, search1 and =
search2, which both have a button named "Submit" with value "Search".  I =
populate a field in search2 and submit this form.  The script would go =
as follows:

<new_selectform
    name=3D"search2" />
<new_setinputfield
    stepid=3D"set lastname"
    name=3D"lastName"
    value=3D"somename" />
<clickbutton
    stepid=3D"click search button"
    label=3D"Search" >
/>

It's pretty simple, but I was getting unexpected results in a web page =
further down the list.  It seems this other JSP was expecting a null =
value from one of the parameters in order to display a certain button.

When I checked the HTTP request that was generated by the search page, =
it was including the fields from search2.

I was expecting:
BigSearch.do?lastName=3Dsomename

but was getting:
BigSearch.do?refNum=3D&lastName=3Dsomename

I ran the same script in HttpUnit code and got the expected result, =
which only contains the lastName parameter and does not include the =
refNum parameter from the other form.

Has anyone else run into this issue?  Is there an option I need to set =
or is WebTest something manipulating the request to include all form =
parameters?

In the meantime, I'm forced to use <invoke> to get around the problem, =
but I'd like to avoid doing so.

Thanks in advance for any help.

- Greg





------_=_NextPart_001_01C47FCE.717EC80F
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.6556.0">
<TITLE>Problem with WebRequest generated by ClickButton</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">I'm a WebTest newbie that just started =
using this application this week.&nbsp; First, I'd like to say that this =
is a great and well designed product that will save me alot of =
trouble.&nbsp; I was trying to find a way to further enhance and =
simplify my HttpUnit automation scripts for the other QA engineers in my =
group and I believe WebTest is the key.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Now, onto my problem.&nbsp; I have a =
page with two forms, search1 and search2, which both have a button named =
&quot;Submit&quot; with value &quot;Search&quot;.&nbsp; I populate a =
field in search2 and submit this form.&nbsp; The script would go as =
follows:</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&lt;new_selectform</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; =
name=3D&quot;search2&quot; /&gt;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;new_setinputfield</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; stepid=3D&quot;set =
lastname&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; =
name=3D&quot;lastName&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; =
value=3D&quot;somename&quot; /&gt;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;clickbutton</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; =
stepid=3D&quot;click search button&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; =
label=3D&quot;Search&quot; &gt;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">/&gt;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">It's pretty simple, but I was getting =
unexpected results in a web page further down the list.&nbsp; It seems =
this other JSP was expecting a null value from one of the parameters in =
order to display a certain button.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">When I checked the HTTP request that =
was generated by the search page, it was including the fields from =
search2.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I was expecting:</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">BigSearch.do?lastName=3Dsomename</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">but was getting:</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">BigSearch.do?refNum=3D&amp;lastName=3Dsomename</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I ran the same script in HttpUnit code =
and got the expected result, which only contains the lastName parameter =
and does not include the refNum parameter from the other =
form.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Has anyone else run into this =
issue?&nbsp; Is there an option I need to set or is WebTest something =
manipulating the request to include all form parameters?</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">In the meantime, I'm forced to use =
&lt;invoke&gt; to get around the problem, but I'd like to avoid doing =
so.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks in advance for any help.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">- Greg</FONT>
</P>
<BR>
<BR>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01C47FCE.717EC80F--