[Webtest] Problem with WebRequest generated by ClickButton

Ji Kim webtest@lists.canoo.com
Wed, 11 Aug 2004 16:58:51 -0700


This is a multi-part message in MIME format.

------_=_NextPart_001_01C47FFF.275A8D4B
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

You might want to look at
http://webtest.canoo.com/selftest/reports/WebTestReport.html#testspec30
and the notes in the corresponding selftest "problemCases.xml" and the
discussion about the new versions of setxxx steps in the mailing
archive.
=20
________________________________

From: webtest-admin@gate2.canoo.com
[mailto:webtest-admin@gate2.canoo.com] On Behalf Of Greg Vatman
Sent: Wednesday, August 11, 2004 4:02 PM
To: webtest@gate2.canoo.com
Subject: RE: [Webtest] Problem with WebRequest generated by ClickButton


After further testing, it looks like an issue with JTidy not parsing the
page properly and treating everything as one form instead of 2.  When I
removed jtidy-r7.jar and added nekohtml.jar, the page was submitted
properly.
=20
Is anyone aware of any JTidy patches?  It seems like the project has
been dead for a couple years already.
=20
- Greg

	-----Original Message-----
	From: webtest-admin@gate2.canoo.com
[mailto:webtest-admin@gate2.canoo.com]On Behalf Of Greg Vatman
	Sent: Wednesday, August 11, 2004 11:10 AM
	To: webtest@gate2.canoo.com
	Subject: [Webtest] Problem with WebRequest generated by
ClickButton
=09
=09

	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=20
	    name=3D"search2" />=20
	<new_setinputfield=20
	    stepid=3D"set lastname"=20
	    name=3D"lastName"=20
	    value=3D"somename" />=20
	<clickbutton=20
	    stepid=3D"click search button"=20
	    label=3D"Search" >=20
	/>=20

	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.=20

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

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

	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.=20

	Thanks in advance for any help.=20

	- Greg=20





------_=_NextPart_001_01C47FFF.275A8D4B
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Problem with WebRequest generated by =
ClickButton</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D738195023-11082004><FONT =
face=3DArial=20
size=3D2>You might want to look at <A=20
href=3D"http://webtest.canoo.com/selftest/reports/WebTestReport.html#test=
spec30">http://webtest.canoo.com/selftest/reports/WebTestReport.html#test=
spec30</A>&nbsp;and=20
the notes in the corresponding selftest "problemCases.xml" and the =
discussion=20
about the new versions of setxxx&nbsp;steps in the mailing=20
archive.</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT>&nbsp;</DIV>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> webtest-admin@gate2.canoo.com=20
[mailto:webtest-admin@gate2.canoo.com] <B>On Behalf Of </B>Greg=20
Vatman<BR><B>Sent:</B> Wednesday, August 11, 2004 4:02 PM<BR><B>To:</B>=20
webtest@gate2.canoo.com<BR><B>Subject:</B> RE: [Webtest] Problem with =
WebRequest=20
generated by ClickButton<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=3D765425522-11082004><FONT face=3DArial color=3D#0000ff =
size=3D2>After=20
further testing, it looks like an issue with JTidy not parsing the page =
properly=20
and treating everything as one form instead of 2.&nbsp; When I removed=20
jtidy-r7.jar and added nekohtml.jar, the page was submitted=20
properly.</FONT></SPAN></DIV>
<DIV><SPAN class=3D765425522-11082004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D765425522-11082004><FONT face=3DArial color=3D#0000ff =
size=3D2>Is=20
anyone aware of any JTidy patches?&nbsp; It seems like the project has =
been dead=20
for a couple years already.</FONT></SPAN></DIV>
<DIV><SPAN class=3D765425522-11082004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D765425522-11082004><FONT face=3DArial color=3D#0000ff =
size=3D2>-=20
Greg</FONT></SPAN></DIV>
<BLOCKQUOTE>
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  webtest-admin@gate2.canoo.com =
[mailto:webtest-admin@gate2.canoo.com]<B>On=20
  Behalf Of </B>Greg Vatman<BR><B>Sent:</B> Wednesday, August 11, 2004 =
11:10=20
  AM<BR><B>To:</B> webtest@gate2.canoo.com<BR><B>Subject:</B> [Webtest] =
Problem=20
  with WebRequest generated by ClickButton<BR><BR></FONT></DIV><!-- =
Converted from text/rtf format -->
  <P><FONT face=3DArial size=3D2>I'm a WebTest newbie that just started =
using this=20
  application this week.&nbsp; First, I'd like to say that this is a =
great and=20
  well designed product that will save me alot of trouble.&nbsp; I was =
trying to=20
  find a way to further enhance and simplify my HttpUnit automation =
scripts for=20
  the other QA engineers in my group and I believe WebTest is the=20
key.</FONT></P>
  <P><FONT face=3DArial size=3D2>Now, onto my problem.&nbsp; I have a =
page with two=20
  forms, search1 and search2, which both have a button named "Submit" =
with value=20
  "Search".&nbsp; I populate a field in search2 and submit this =
form.&nbsp; The=20
  script would go as follows:</FONT></P>
  <P><FONT face=3DArial size=3D2>&lt;new_selectform</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp; name=3D"search2" /&gt;</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&lt;new_setinputfield</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp; stepid=3D"set lastname"</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp; name=3D"lastName"</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp; value=3D"somename" /&gt;</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&lt;clickbutton</FONT> <BR><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;=20
  stepid=3D"click search button"</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp; label=3D"Search" &gt;</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>/&gt;</FONT> </P>
  <P><FONT face=3DArial size=3D2>It's pretty simple, but I was getting =
unexpected=20
  results in a web page further down the list.&nbsp; It seems this other =
JSP was=20
  expecting a null value from one of the parameters in order to display =
a=20
  certain button.</FONT></P>
  <P><FONT face=3DArial size=3D2>When I checked the HTTP request that =
was generated=20
  by the search page, it was including the fields from search2.</FONT> =
</P>
  <P><FONT face=3DArial size=3D2>I was expecting:</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>BigSearch.do?lastName=3Dsomename</FONT> </P>
  <P><FONT face=3DArial size=3D2>but was getting:</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>BigSearch.do?refNum=3D&amp;lastName=3Dsomename</FONT> </P>
  <P><FONT face=3DArial size=3D2>I ran the same script in HttpUnit code =
and got the=20
  expected result, which only contains the lastName parameter and does =
not=20
  include the refNum parameter from the other form.</FONT></P>
  <P><FONT face=3DArial size=3D2>Has anyone else run into this =
issue?&nbsp; Is there=20
  an option I need to set or is WebTest something manipulating the =
request to=20
  include all form parameters?</FONT></P>
  <P><FONT face=3DArial size=3D2>In the meantime, I'm forced to use =
&lt;invoke&gt;=20
  to get around the problem, but I'd like to avoid doing so.</FONT> </P>
  <P><FONT face=3DArial size=3D2>Thanks in advance for any help.</FONT> =
</P>
  <P><FONT face=3DArial size=3D2>- Greg</FONT>=20
</P><BR><BR><BR></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C47FFF.275A8D4B--