Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fillField failing for good "field" #345

Open
crossan007 opened this issue Jul 9, 2019 · 8 comments

Comments

@crossan007
Copy link

commented Jul 9, 2019

Seeing a weird issue when running ChromeDriver 75, Behat 3.5.0, MinkExtension 2.3.1 on Windows with Selenium

Every call to MinkContext::fillField fails because Behat\Mink\Element::findAll returns null, and I get an ElementNotFoundException.

The referenced field is valid, and works in my CI tests (running older versions of dependencies and via SauceLabs)

I took a look at the generated xPath, and it looked really over-complicated(but might still have been valid).

I don't see anything in the selenium console logs to indicate a failed "find", but I'm not sure it would show there anyway.

Any pointers where to dig deeper?

@SirPL

This comment has been minimized.

Copy link

commented Jul 9, 2019

I'm facing similar issue which may be related to this one – the $page->getContent() returns valid HTML code, but $page->find('css', 'html') returns null. The same occurs for every other valid tag and id.

@crossan007

This comment has been minimized.

Copy link
Author

commented Jul 9, 2019

yes; $page->getContent() does return the DOM

@crossan007

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

I reverted my Chrome browser from Version 75 to Version 74, and also reverted my version of ChromeDriver.exe, and the problem appears to have gone away.

It would appear that something in the upgrade from Chrome 74 to Chrome 75 (or ChromeDriver) causes this issue

@crossan007

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

I seem to get this error on Firefox 68 with GeckoDriver as well.

Still digging in to see if I can figure out the culprit.

@crossan007

This comment has been minimized.

Copy link
Author

commented Jul 12, 2019

I think this is documented as in issue in the GeckoDriver repository: mozilla/geckodriver#1581

It's odd that it seems to affect both Chrome and Firefox equally

@crossan007

This comment has been minimized.

Copy link
Author

commented Jul 12, 2019

Ah ha. I think I uncovered some more details here.

It looks like, starting with Chrome 75, the selenium mode defaults to w3c, and the MinkSelenium2Driver is considering switching from instaclick/php-webdriver to facebook/php-webdriver, but is holding off because of PHP7 support: minkphp/MinkSelenium2Driver#293 (comment)

@crossan007

This comment has been minimized.

Copy link
Author

commented Jul 12, 2019

And a solution! (Or at least a temporary workaround):

In the thread above, they suggested turning off W3C mode for chrome.

So, adding that to my behat.yml file, I get this (note the extra_capabilities, chromeOptions, w3c:false)

default:
  suites:
        default:
            contexts:
                - nwcontext:form
                - nwcontext:formstone
                - nwcontext:select2
                - FeatureContext
  extensions:
    Novaway\CommonContexts\Extension: ~
    Behat\MinkExtension:
      base_url: http://localhost/crm
      selenium2:
        browser: chrome
        capabilities:
          browserName: "chrome"
          extra_capabilities:
            chromeOptions:
              w3c: false
crossan007 added a commit to ChurchCRM/CRM that referenced this issue Jul 12, 2019
Ensure chrome has W3C mode disabled.
Mink Extension's fill field fails because W3C mode on Chrome 75+ causes MinkSelenium2Driver to break:
Behat/MinkExtension#345
and
minkphp/MinkSelenium2Driver#293 (comment)
@crossan007

This comment has been minimized.

Copy link
Author

commented Jul 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.