[Webtest] how to click on an image w/o a name?

Dierk Koenig webtest@lists.canoo.com
Thu, 4 Sep 2003 13:22:24 +0200


Well, if for some reason one cannot actually "click" through webtest,
the fallback is to use <invoke ...> to mimic the click behaviour.

In pseudo code :

if your scenario is 

	set a=b	
	click

you would do

	invoke url="${mypage}?a=b"

that does not test whether the button actually appears on
the page. Therefore you may want to test this beforehand
e.g. by 

	verifytext "document.write('banana')"

if the above parameters are dynamic, i.e. cannot be determined
before test execution, you can use 
	storeregex or storexpath
to extract them from a page and use then like #{property}

cheers
Mittie

> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Richard Raue
> Sent: Donnerstag, 4. September 2003 12:15
> To: webtest@gate.canoo.com
> Subject: Re: [Webtest] how to click on an image w/o a name?
> 
> 
> Welcome back,
> 
> So WT doesn't "see" that javascripted button I want it to click on?
> Well, thats bad, becaus it's impossible for me to customize the 
> code of the
> original page. All I can do is changing the test-file.
> 
> Would be happy about any further help.
> 
> greetings,
> Richard
> 
> ----- Original Message -----
> From: "Dierk Koenig" <dierk.koenig@canoo.com>
> To: <webtest@gate.canoo.com>
> Sent: Thursday, September 04, 2003 10:51 AM
> Subject: RE: [Webtest] how to click on an image w/o a name?
> 
> 
> > Hi Richard,
> >
> > your webtest is almost fine. You shouldn't provide the "label"
> > or "name" unless there is one. Form/index locator will do the job.
> >
> > Problems are that you are writing the html through the javascript
> > document.write() method. WebTest will not recognize it.
> >
> > Try putting your html directly into your page and your tests will
> > find it.
> >
> > cheers
> > Mittie
> >
> > > -----Original Message-----
> > > From: webtest-admin@lists.canoo.com
> > > [mailto:webtest-admin@lists.canoo.com]On Behalf Of Richard Raue
> > > Sent: Donnerstag, 4. September 2003 10:39
> > > To: webtest@gate.canoo.com
> > > Subject: [Webtest] how to click on an image w/o a name?
> > >
> > >
> > > Hi,
> > >
> > > I need to click on an image that has no name-attribute specified.
> > >
> > > source code of the page to test:
> > >
> > >     document.write("<input type='image' name=''
> > > src='/is-bin/intershop.static/WFS/PK/
> > >     /de_DE/images/bt_weiter_mag.gif' border='0'
> > > onClick='submitForm_NextSelection()'>");
> > > _____________________________________________________________________
> > >
> > > settings in the xml-testfile:
> > >
> > >     <clickbutton stepid="Click Weiter" name=""
> > > 
> label="/is-bin/intershop.static/WFS/PK//de_DE/images/bt_weiter_mag.gif">
> > >        <form name="formA"/>
> > >        <index value="0"/>
> > >     </clickbutton>
> > > _____________________________________________________________________
> > >
> > > This version doesn't work, because the label-value isn't correct. But
> what
> > > else is there to identify the link-image?
> > >
> > > thx for help,
> > > Richard
> > >
> > > PS: I'm a newbie, so please excuse potential nonconformities!
> > >
> > > _______________________________________________
> > > 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
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> 
>