1

I've created an XPath to click on the 'bag' icon at the top right-hand corner of the page once I've selected the shoe size and added to the bag. I've created an XPath for this but it seems to throw an exception when this is run:

webDriver.FindElement(By.XPath(".//button[@data-testid='bagicon']")).Click();

http://www.asos.com/nike/nike-air-max-97-trainers-in-gold-884421-700/prd/9059998?clr=gold&SearchQuery=nike%20trainers&gridcolumn=1&gridrow=1&gridsize=4&pge=1&pgesize=72&totalstyles=512

1 Answer 1

1

Change the Xpath as below

//a[@data-testid='bagIcon']
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.