[Webtest] How to click button

Paul King webtest@lists.canoo.com
Wed, 12 Jul 2006 21:59:28 +1000


You could try something like:

<clickLink xpath="//A[img/@alt='btncart.gif']" .../>

Cheers, Paul.

amol kashetwar wrote:
> Hi Colin,
>  
> Follwing is the code for button as displayed in view source of the web 
> page. 
>  
> Code:
>  
> <div class="clearer">
>                     &nbsp;
>                 </div>
>              <div id="newbtns">
>                     <div id="firstnewbtn"><A href="< 
> URL>/o9akDujq22FI1sXqSnhU/1.0.0.9.13.1.3.1.10"> <img 
> <http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/1384000/wo/o94jJxakDujq22nAkFI1sXqSnhU/1.0.0.19.1.0.8.9.13.1.3.1.1.7.0.0"><img> 
> border="0" alt="btncart.gif" src="<URL>/btncart.gif 
> <http://a248.e.akamai.net/7/248/2041/1072/store.apple.com/Catalog/US/Images/ips_btnaddtocart.gif>" 
> align="bottom"></a></div>
>  
> <url> is the manipulated.
>  
> Thanks,
>  
>  
>  
> On 7/12/06, *Colin O'Brien* <colin.obrien@capetechnologies.com 
> <mailto:colin.obrien@capetechnologies.com>> wrote:
> 
>     Hi Amol,
> 
>      
> 
>     Can you view the source of the page you're trying to work on and
>     send the a sample where the button is, it should be possible to give
>     you an example for clickButton then…
> 
>      
> 
>     Regards,
> 
>     Colin.
> 
>      
> 
>     -----Original Message-----
>     *From:* webtest-admin@lists.canoo.com
>     <mailto:webtest-admin@lists.canoo.com>
>     [mailto:webtest-admin@lists.canoo.com
>     <mailto:webtest-admin@lists.canoo.com>] * On Behalf Of *amol kashetwar
>     *Sent:* 12 July 2006 12:10
>     *To:* webtest@lists.canoo.com <mailto:webtest@lists.canoo.com>
>     *Subject:* Re: [Webtest] How to click button
> 
>      
> 
>     Hi Colin,
> 
>      
> 
>     Thanks for information
> 
>     I tried aroud it, but could NOT get solution.
> 
>     Please could you send some example how to use it with clickLink or
>     clickButton.
> 
>      
> 
>     On 7/12/06, *Colin O'Brien* < colin.obrien@capetechnologies.com
>     <mailto:colin.obrien@capetechnologies.com>> wrote:
> 
>     Hi Amol,
> 
>      
> 
>     The <clickButton/> step now supports xpath. You should be able to
>     address the button using xpath if all the usual attributes are missing
> 
>      
> 
>     Click Button Manual page:
> 
>     http://webtest.canoo.com/webtest/manual/clickButton.html
> 
>      
> 
>     Regards,
> 
>     Colin.
> 
>      
> 
>     -----Original Message-----
>     *From:* webtest-admin@lists.canoo.com
>     <mailto:webtest-admin@lists.canoo.com>
>     [mailto:webtest-admin@lists.canoo.com
>     <mailto:webtest-admin@lists.canoo.com>] * On Behalf Of *amol kashetwar
>     *Sent:* 12 July 2006 07:40
>     *To:* webtest@lists.canoo.com <mailto:webtest@lists.canoo.com>
>     *Subject:* [Webtest] How to click button
> 
>      
> 
>     Hi,
> 
>     I want to click on button which is NOT having any name, label, Id
>     field set. It is having href which is in session. Please could any
>     body help me to write a code to click such type of button entity
>     using canoo webtest.
> 
>      
> 
>     Thanks,
> 
>      
> 
>      
> 
>