AW: [Webtest] Problem with input element of type="image"

webtest@lists.canoo.com webtest@lists.canoo.com
Thu, 17 Oct 2002 09:20:59 +0200


Hi,

I added some logging code to the com.canoo.webtest.steps.Target class =
to log
the request parameters=20
along with the URL posted.

Here is the reelvant part of the trace produced:

[testSpec] Start Step: Click 'Verbrauchsprognose =F7ffnen'" (15/24)
[testSpec] -> gotoTarget(by request): POST request for
/ecom3/service/jsp/b2b/sec/uc5/ForecastDetail.do
[testSpec]      request parameter: forecastId =3D '1003'
[testSpec]      request parameter: btn_open =3D ''
[testSpec] Completed Step: Click 'Verbrauchsprognose =F7ffnen'" (15/24)


As you can ses, the parameter named 'btn_open' is empty.=20

Here again is the html code for my button:

<input type=3D"image" name=3D"btn_open"
src=3D"/ecom3/service/images/buttons/de/sec/uc5/scr0_btn_open.gif" =
border=3D"0">


and here the ant step:

<clickbutton stepid=3D"Click 'Verbrauchsprognose =F6ffnen'" =
name=3D"btn_open"/>


Do I have to specify additional properties for the the clickbutton =
step?
I tried to add an 'x' and 'y' properties to the step, but without =
success!
Any suggestion how I could find out where the problem is?

Thanks Robert



PS: here is the code I added into the Target class:

private WebResponse gotoTarget(TestContext context, String url, =
WebRequest
request)=20
	throws IOException, MalformedURLException, SAXException {
  WebResponse resp =3D null;
  try {
    installHtmlErrorHandlerIfNeeded(context);
    if (request !=3D null && url =3D=3D null) {
      logText(context, "-> gotoTarget(by request): " + request);
// +++ start addition
	String[] params =3D request.getRequestParameterNames();
      for (int i =3D 0; i < params.length; i++) {
        logText(context, "     request parameter: " + params[i] + " =3D =
'"=20
                         + request.getParameter(params[i]) + "'");
      }
// --- end addition
      resp =3D getResponse(context, request);
    } else if (url !=3D null && request =3D=3D null) {
    .  =20
    .
    .


> -----Urspr=FCngliche Nachricht-----
> Von: Dierk Koenig [mailto:dierk.koenig@canoo.com]
> Gesendet: Dienstag, 15. Oktober 2002 15:02
> An: webtest@lists.canoo.com
> Betreff: RE: [Webtest] Problem with input element of type=3D"image"
>=20
>=20
> Hi,
>=20
> your code should work like provided.
>=20
> Canoo WebTest fills the name.x and name.y values with 0.
>=20
> The Report of the automated tests that Canoo WebTest uses
> to test itself show this.
> - go to=20
> http://webtest.canoo.com/selftest/TestResultOverview.html#testspec13
>   This is the result page of the tests of the latest build.
>   You will find some clickbutton steps for ImageButtons.
> - select one of the "Resulting page" links with the green background
>   (e.g.=20
> http://webtest.canoo.com/selftest/lastResponse1032513277993.html)
>   to see the page that was returned. You will find the .x and=20
> .y values
>   listed at the bottom.
>=20
> You can use this as an example of the clickbutton with image buttons.
> Try to find out where your code differs from the example.
>=20
> Please tell us about your findings.
>=20
> cheers Mittie
>=20
> P.S. just as an idea: are you sure that the right form was submitted?
>=20
> > -----Original Message-----
> > From: webtest-admin@lists.canoo.com
> > [mailto:webtest-admin@lists.canoo.com]On Behalf Of
> > sem.Gottofrey@bkw-fmb.ch
> > Sent: Dienstag, 15. Oktober 2002 14:04
> > To: webtest@lists.canoo.com
> > Subject: [Webtest] Problem with input element of type=3D"image"
> >
> >
> > Hi all,
> >
> > Having following HTML code in my JSP,
> >
> > 	<input type=3D"image" name=3D"btn_open" =
src=3D"/images/btn_open.gif"
> > border=3D"0" alt=3D"open">
> >
> > I can submit my form with the following webtest element:
> >
> > 	<clickbutton stepid=3D"Click 'Open forecast'"  name=3D"btn_open" =
/>
> >
> > When the form get submitted, the two parameters 'btn_open.x' and
> > 'btn_open.y' should be
> > available on the request, but they are not.
> >
> > Am'I missing something?
> >
> > Thanks
> > Robert
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> >
>=20
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>=20