Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97813

Check element exists using PHP Selenium 2 Webdriver?

$
0
0

I am trying to check if an element on a page exists by CSS using Selenium 2. Anyone have any examples using PHP Selenium Webdriver Facebook wrapper?

I have tried the below code:

if($driver->findElement(WebDriverBy::xpath("image-e4e")) != 0)
{
}

But gives me this error:

Fatal error: Uncaught exception 'NoSuchElementWebDriverError' with message 'Unable to locate element: {"method":"xpath","selector":"image-e4e"}


Viewing all articles
Browse latest Browse all 97813

Trending Articles