I have 3 divs. Every one contains a button. Every button in every div has the same XPath:
//*[@id='variant_selector']/div/div[2]/div[3]/span
The XPaths for the div‘s are different:
//*[@id='product_sets']/div[1],
//*[@id='product_sets']/div[2],
//*[@id='product_sets']/div[3]
How can I click for example the button in div 2 using Selenium?
I guess you need to post the html to be sure, but doesn’t combining the two work?
This is the div XPath first, followed by the XPath for selecting the button inside the div.