[Webtest] A problem with <clickbutton...> used with image but
tons
PETERSON,STEPHEN (A-Sonoma,ex1)
webtest@lists.canoo.com
Fri, 26 Apr 2002 08:23:57 -0600
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C1ED2E.0055DC30
Content-Type: text/plain;
charset="iso-8859-1"
Hi Carsten,
I've attached a ZIP with 3 files:
imageButtonPage.htm - a very simple form that uses an image button to submit
button.gif - the image for the button used by imageButtonPage.htm
imageButtonTest.htm - the test
Unfortunately I don't know how (or if) WebTest can verify the parameters
submitted... The HTML has a little bit of JavaScript to display
window.location so you can use a browser to see the normal parameters but
since WebTest doesn't handle JavaScript this doesn't help. By the way, I
only checked the JavaScript on IE 5.01
The only way I know to check the operation of WebTest is to place the HTML
and GIF files on a server and use a TCP monitor / sniffer / proxy such as
tcpmon (included with Apache Axis and available from
http://xml.apache.org/axis/). I used tcpmon with the browser and webtest
pointing to localhost:8080 (the tcpmon listen port) and tcpmon redirected
the requests to localhost:80.
=========== The request from a browser after clicking the image button
======================
GET
/imageButtonPage.htm?textInput=normal+input&imageButton.x=20&imageButton.y=1
5 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword,
*/*
Referer: http://localhost:8080/imageButtonPage.htm
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Host: localhost:8080
Connection: Keep-Alive
The important part to note is that the GET includes:
imageButton.x=20&imageButton.y=15
=========== The request from WebTest after <clickbutton> on the image button
======================
GET /imageButtonPage.htm?textInput=Normal+input+example HTTP/1.1
Referer: http://localhost:8080/imageButtonPage.htm
User-Agent: Java1.3.1_01
Host: localhost:8080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Note that the parameters for the GET does *not* include imageButton.x or
imageButton.y although it does include textInput (an <input
type="text"...>). Anything that does not depend on the image button
parameters will work fine.
Let me know if I can provide any additional help or information.
Thanks for your time.
Stephen
-----Original Message-----
From: Carsten Seibert [mailto:seibert@acm.org]
Sent: Thursday, April 25, 2002 10:03 PM
To: webtest@gate.canoo.com
Subject: RE: [Webtest] A problem with <clickbutton...> used with image
buttons
Hi Stephen
Well, currently is the image button feature still kind of "experimental".
That's why there no documentation yet. But there is a functional test in
selfTestImpl.html (testClickButton) which seems to run fine.
In order to help us reproducing the problem could you please provide a
minimal WebTest script and the corresponding HTML page used by the test?
Thanks,
Carsten
Carsten Seibert
seiberTEC GmbH Switzerland
mailto:seibert@seibertec.ch / phone: +41 79 636 4317
> -----Original Message-----
> From: stephen_peterson@agilent.com
> [mailto:stephen_peterson@agilent.com]
> Sent: Donnerstag, 25. April 2002 22:57
> To: webtest@gate.canoo.com
> Subject: [Webtest] A problem with <clickbutton...> used with image
> buttons
>
>
> Hi,
>
> I am using WebTest to check HTML that uses
>
> <form method="POST" action=...>
> ....
> <input type="image" name="myButton" src=...>
> </form>
>
> And a WebTest step
>
> <clickbutton stepid="click image button" name="myButton"
> x="0" y="0"/>
>
> NOTE: the x and y attributes are not specified in syntax.html, but are
> supported by ClickButton.
>
> The form is submitted with all the appropriate parameters
> *except* the X and
> Y values (for
> the HTML snippet above there should be two additional parameters:
> myButton.x and
> myButton.y).
>
> What seems to be happening is:
>
> If HttpUnitOptions.getParameterValuesValidated() is true
> (which seems to be
> the default),
> then the WebRequest constructed by
> ButtonByXxx.locateRequest() uses WebForm
> as
> the ParameterHolder. The problem:
> WebForm.selectImageButtonPosition() only
> sets the
> button location with SubmitButton.setLocation() and does not
> generate the
> ".x" and ".y"
> parameters. The result is these parameters are missing from the POST
>
> However, if HttpUnitOptions.getParameterValuesValidated() is
> false, then the
> WebRequest is
> constructed using new UncheckedParameterHolder( WebForm) as the
> ParameterHolder (see
> WebRequest.newParameterHolder() ).
> UncheckedParameterHolder.selectImageButtonPosition()
> adds the ".x" and ".y" parameters to the request.
>
> I have verified that my tests work as expected (e.g. include
> the ".x" and
> ".y" parameters
> are included) by modifying ClickButton.doExecute() to
>
> protected void doExecute(TestContext context) throws Exception {
> boolean oldValue =
> HttpUnitOptions.getParameterValuesValidated();
> HttpUnitOptions.getParameterValuesValidated( false );
>
> /* the original contents of doExecute() go here */
>
> HttpUnitOptions.getParameterValuesValidated(
> oldValue );
> }
>
> HttpUnitOptions.getParameterValuesValidated() enables /
> disables an error
> check for
> parameter values that cannot be set via the browser -- hence
> turning this
> off is not a great
> solution.
>
> Does anyone have another way to solve this problem?
>
> Thank you.
>
> Stephen
>
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest
------_=_NextPart_000_01C1ED2E.0055DC30
Content-Type: application/octet-stream;
name="imagetest.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="imagetest.zip"
UEsDBAoAAAAAAGMxVyrMlBJo0AUAANAFAAAKAAAAYnV0dG9uLmdpZkdJRjg3YSAAGAD3AAD///+l
c3P/jIz/AADGAAD/EADvOSn/KRjGEAD/pZT/KQD/rZy1a1qtIQDeUin/QgDvSgD/jFLWUhCMMQDn
UgD/tYTvpWveYwCMe2vGYwjOawC1cyG9lFpzQgD/1pS1cwCMe1qUe0qtewDGpTn/55RaSgDv3nuc
hADWxlKUhADn72O9xmN7jABCSgB7hErn/3uErRCMrUpjlAB7hGtrhELG/2MxUgBSlABCewBKcyFC
nAAYWgAxlBAppQApnABjjFpClDEQnAAQpQBKhEoYnBgAxgAAawAAYwAApQgApRgQnCkA/ykA/zkA
rSkApSkhnEJajGsQWikA/1IArTkAGAhazoQApTkA/2MAnEI51oQArVJKjGsApVIA/4RCpXsY1oQA
rWNj77UA3oQA55RC77UY97UA/7UxjHMA/70A57VjjIQAY1IAa1oAQjkASkIAraVrhIQIe3sA//8A
QkIA7/8AnKUArb1CjJQAtd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