php-selenium-client
php-selenium-client copied to clipboard
sometimes $results['value']['ELEMENT'] is not defined inside WebDriver.php line 368
added this line
if (!isset($results['value']['ELEMENT'])) throw new SeleniumNoSuchElementException();
I dunno if thats the best error to throw, but its better than leaving it completely unhandled and getting notices.
return new WebElement($this, $results['value']['ELEMENT']);#just showing this line for reference
Ran into the same issue, but instead used
return isset($results['value']['ELEMENT']) ? new WebElement($this, $results['value']['ELEMENT']) : null;
The function is be triggered by waitForElementUntilIsPresent() when used By::id(), so throwing a exception isn't the best solution imo.