Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

fillField failing for good "field" #345

Description

@crossan007

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?

Activity

  1. SirPL commented on Jul 9, 2019

    @SirPL

    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.

  2. crossan007 commented on Jul 9, 2019

    @crossan007
    Author

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

  3. crossan007 commented on Jul 10, 2019

    @crossan007
    Author

    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

  4. crossan007 commented on Jul 10, 2019

    @crossan007
    Author

    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.

  5. crossan007 commented on Jul 12, 2019

    @crossan007
    Author

    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

  6. crossan007 commented on Jul 12, 2019

    @crossan007
    Author

    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)

  7. crossan007 commented on Jul 12, 2019

    @crossan007
    Author

    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
    
  8. crossan007 commented on Jul 12, 2019

    @crossan007
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions