instaclick / php-webdriver

W3C and Selenium 2 webdriver "thin client" for php 5.3+ and namespaces.
Other
435 stars 62 forks source link

Element not found with xpath-Exception in Behat project with Selenium and ChromeDriver 77 #98

Closed mvoelker closed 5 years ago

mvoelker commented 5 years ago

I do have massive problems with the current version of ChromeDriver in a Behat project. All Behat\Mink\WebAssert->pageTextContains('xyz') calls fail with an Element not found with xpath, //html in vendor\instaclick\php-webdriver\lib\WebDriver\Exception.php:155 error.

Not sure if the problem source is Behat / Mink / Selenium2 / Selenium2-Driver / php-webdriver / ChromeDriver or Chrome itself. I hoped that the new version 1.4.6 of php-webdriver will fix the problem ... but it did not.

(Relevant) Callstack:

And I wait to see "__content_loaded__and__init_done__"                     # FeatureContext::iWaitForTheTextToAppear()
    WebDriver\Exception\NoSuchElement: Element not found with xpath, //html
     in vendor\instaclick\php-webdriver\lib\WebDriver\Exception.php:155
    Stack trace:
    #0 vendor\instaclick\php-webdriver\lib\WebDriver\Container.php(89): WebDriver\Exception::factory(7, 'Element not fou...')
    #1 vendor\behat\mink-selenium2-driver\src\Selenium2Driver.php(974): WebDriver\Container->element('xpath', '//html')
    #2 vendor\behat\mink-selenium2-driver\src\Selenium2Driver.php(511): Behat\Mink\Driver\Selenium2Driver->findElement('//html')
    #3 vendor\behat\mink\src\Element\Element.php(176): Behat\Mink\Driver\Selenium2Driver->getText('//html')
    #4 vendor\behat\mink\src\WebAssert.php(257): Behat\Mink\Element\Element->getText()
    #5 vendor\behat\mink-extension\src\Behat\MinkExtension\Context\MinkContext.php(292): Behat\Mink\WebAssert->pageTextContains('__content_loade...')
    #6 features\bootstrap\FeatureContext.php(367): Behat\MinkExtension\Context\MinkContext->assertPageContainsText('__content_loade...')

Versions from composer.json:

Runtime versions:

Issue https://github.com/instaclick/php-webdriver/issues/92 sounds similar.

Any help is highly appreciated.

robocoder commented 5 years ago

Would need to backport be87042314cc654f7ff3e26c20a998cadb23daac

robocoder commented 5 years ago

Fixed in 7e179d5535a23da214df091805c029ff92bcc26d

mvoelker commented 5 years ago

I applied this patch / backported code change and it solves my problem. Thank you - @robocoder - very much for this quick response and fix.