php-selenium-client icon indicating copy to clipboard operation
php-selenium-client copied to clipboard

sometimes $results['value']['ELEMENT'] is not defined inside WebDriver.php line 368

Open ghost opened this issue 12 years ago • 1 comments

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

ghost avatar Oct 29 '13 19:10 ghost

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.

thekeyboardbum avatar Apr 01 '14 23:04 thekeyboardbum