RE: How to click on particular button?.

Hi,

How to click on particular button?, when the all identifiers are same?.

Please find the below Screenshot, HTML and application URL.

Image:

RE: How to click on particular button?.

HTML:


<input type="submit" class="wpsc_buy_button" name="Buy" value="Add To Cart">

URL:
http://store.demoqa.com/products-page/product-category/accessories/

Rocky Doctor Asked on September 7, 2014 in Selenium WebDriver.
Add Comment
6 Answers

One of the many answer is: use Xpath in this condition 🙂 , for example.
 


.//*[@id='default_products_page_container']/div[3]/div[2]/form/div[2]/div[1]/span/input
.//*[@id='default_products_page_container']/div[4]/div[2]/form/div[2]/div[1]/span/input

In another question I saw that you are working on MDF and I think you required generic code, but sorry friend I don’t know that 🙁 .

Other people will suggest you the different solutions..

Vice Professor Answered on September 7, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.