Unable to locate element Module 17 Session 5 | Selenium Forum
M
Posted on 10/02/2016
Module 17, session #5 Unable to locate element

Web page is:
https://uk.webuy.com/search/index.php?stext=*&section=&catid=956

as soon as you click "I want to buy this item" button, on right hand side you will see: 1 item/s View

For following line:
String count = driver.findElement(By.id("buyBasketCount")).getText();

and I get: [b:11hyzwhh]Unable to locate element[/b:11hyzwhh]

I tried the following line:

String count = driver.findElement(By.xpath("//div[@class='buyBasketContent']/td[1]/span")).getText();

which gives me the same error message.

How do I access this element (1 item/s)?

Thank you in advance for your help

M
Replied on 11/02/2016

try wait statement.