php-webdriver / php-webdriver

PHP client for Selenium/WebDriver protocol. Previously facebook/php-webdriver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

W3C WebDriver protocol support

OndraM opened this issue · comments

This is an issue to plan and track progress of implementing W3C WebDriver protocol into php-webdriver.

Currently, only legacy JsonWire (aka OSS) protocol is supported by php-webdriver. Selenium server 3.x translates the protocol if needed for the remote end (browser). However not everything is translated (like actions()), making some of the features not working with remote ends supporting only the W3C protocol (which is currently only GeckoDriver for Firefox 48+).

Since Selenium 3.5 the translation to old protocol is disabled by default. It still could be reenabled by starting the server like java -jar selenium-server-standalone-3.5.3.jar -enablePassThrough false, but this is only partial and temporary solution/workaround.

For Docker 🐳 users: use SE_OPTS environment variable to pass the enablePassThrough option to Selenium server. Ie. add -e "SE_OPTS=-enablePassThrough false" to docker run command.

The work would require eg.:

  • add some more functional tests, to make sure we don't breake the old protocol while doing the necessary refactoring
  • prepare handshake to detect whether the remote end is speaking JsonWire or W3C dialect (we need this to support the old browsers etc.)
  • define common interface for Json and W3C protocol
  • convert current implementation to use this interface
  • implement adapter for the W3C protocol
  • implement GeckodriverService or something like that to start geckodriver locally
    ...

Resources

I started working on https://github.com/facebook/php-webdriver/wiki/JsonWireProtocol-vs.-W3C-WebDriver . I'd like to summarize there the key protocol differences before we start actually implementing them in the code.

Any help with this overview document will be much appreciated!

Spec also contains changes about the JSON returned when finding an element.
The key ELEMENT is no longer used for referencing an element so we have an undefined index in RemoteWebDriver.php line 178. See this issue on selenium for more details.

Here is an example of the JSON returned by IEDriverServer (which now implements the spec in its latest version, 3.6):
{"state":"success","sessionId":null,"hCode":1164912850,"value":{"element-6066-11e4-a52e-4f735466cecf":"a1c4646c-8300-49f2-84b3-182911dc3eb6"},"class":"org.openqa.selenium.remote.Response","status":0}

It would be great if the docs were updated to warn people about this and potentially save them a couple hours of pain. Are you interested in a PR to this effect?

@davidmintz I've recently added note about passThourghMode to readme. However we can do more, for sure :). What is on your mind?

I'm also hoping to have some time for the issue itself during November...

@OndraM sorry, I guess I missed that in the README, but I read your discussion about -enablePassThrough false, and tried it, but I am still exploding when I try to sendKeys(), with
Facebook\WebDriver\Exception\UnrecognizedExceptionException: Expected [object Undefined] undefined to be a string and I 'm unclear whether this rooted in the same issue as the undefined 'ELEMENT" index, or something else.

I do know it's making me crazy and I would love to help, just don't know if I have what it takes in terms of knowledge.

At the moment the only workaround that works for me is to use a very dated toolchain: Selenium 2.44 with Firefox 35. With the current versions of everything plus Chrome, I get "chrome is unreachable" and I've been all over the map trying to solve that one.

Note for Docker users: Selenium parameters are passed through SE_OPTS env variable. i.e, you need to add -e "SE_OPTS=-enablePassThrough false" to docker run command

Hi @OndraM ! Happy new year ;)

Any news on this issue ? I've found this Github repo which is based on an old version of this project and which implements the W3C protocol (at least it says so). Maybe it could help !

commented

For selenium-server-standalone version > 3.9.1: the option enablePassThrough doesn't work, just switch to version 3.8.1 to use this workaround for firefox

Hi everyone, I'm aware of the situation, including the fact you cannot effectively use Selenium 3.9.0+ with remote ends supporting only the new W3C protocol (especially Firefox), due to removal of the enablePassThrough - you must stick with the previous version for the time being. Sorry for this! However those remote ends, which sill supports the old protocol (like Chrome) still DO work perfectly.

I also hope I will be able to share some more information about W3C protocol support quite soon. I know the missing support may be limiting for you now (but also workaround exists - see previous messages), but please hang tight :).

Sorry, my previous statement was not accurate - you only cannot use Selenium 3.9 with remote ends supporting only the new W3C protocol (especially Firefox), because Selenium Server now won't do the translation to the new protocol. But those remote ends, which sill supports the old protocol (like Chrome) still DO work perfectly.

Hi @OndraM ,

Do we have any ETA for this task?

Hi everyone,
I recently downloaded v 3.12 and the problems still persist (with Firefox).
Can someone confirm that for me? Many thanks!

Hello everyone , Same issue for me in v3.12.0
any estimate on implementing JsonWire protocol? all development stopped with phpwebdriver due to this :(

yet another bump, pretty annoying issue. For anyone wanting a quick link to a version of selenium that works: https://selenium-release.storage.googleapis.com/index.html?path=3.8/

As of the time of this writing, it seems to work with me on Ubuntu Linux, FF version 61.0.1 (with the Selenium server 3.8.1)

Latest version which works for me is still 2.53.1 - I get different errors with 3.8 (when filling a field) or 3.13 (can't open any page).

From : https://www.w3.org/TR/webdriver/

Implementation of W3 by chrome : https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromedriver_status.md

Implementation of W3 by Microsoft (Edge) : https://docs.microsoft.com/en-us/microsoft-edge/webdriver#commands

Implementation of W3 by Apple (Safari) : https://developer.apple.com/documentation/webkit/macos_webdriver_commands_for_safari_12_and_later

Implementation of JsonWire by Apple (Safari) : https://developer.apple.com/documentation/webkit/macos_webdriver_commands_for_safari_11_1_and_earlier

Below you will find:

  • List of W3 commands
  • List of commands by constant name with url
Implemented Method URI Template Command
✔️ POST /session New Session
✔️ DELETE /session/{session id} Delete Session
GET /status Status
GET /session/{session id}/timeouts Get Timeouts
✔️ POST /session/{session id}/timeouts Set Timeouts
✔️ POST /session/{session id}/url Navigate To
✔️ GET /session/{session id}/url Get Current URL
✔️ POST /session/{session id}/back Back
✔️ POST /session/{session id}/forward Forward
✔️ POST /session/{session id}/refresh Refresh
✔️ GET /session/{session id}/title Get Title
GET /session/{session id}/window Get Window Handle
✔️ DELETE /session/{session id}/window Close Window
✔️ POST /session/{session id}/window Switch To Window
GET /session/{session id}/window/handles Get Window Handles
✔️ POST /session/{session id}/frame Switch To Frame
POST /session/{session id}/frame/parent Switch To Parent Frame
GET /session/{session id}/window/rect Get Window Rect
POST /session/{session id}/window/rect Set Window Rect
POST /session/{session id}/window/maximize Maximize Window
POST /session/{session id}/window/minimize Minimize Window
POST /session/{session id}/window/fullscreen Fullscreen Window
✔️ GET /session/{session id}/element/active Get Active Element
✔️ POST /session/{session id}/element Find Element
✔️ POST /session/{session id}/elements Find Elements
✔️ POST /session/{session id}/element/{element id}/element Find Element From Element
✔️ POST /session/{session id}/element/{element id}/elements Find Elements From Element
✔️ GET /session/{session id}/element/{element id}/selected Is Element Selected
✔️ GET /session/{session id}/element/{element id}/attribute/{name} Get Element Attribute
GET /session/{session id}/element/{element id}/property/{name} Get Element Property
✔️ GET /session/{session id}/element/{element id}/css/{property name} Get Element CSS Value
✔️ GET /session/{session id}/element/{element id}/text Get Element Text
✔️ GET /session/{session id}/element/{element id}/name Get Element Tag Name
GET /session/{session id}/element/{element id}/rect Get Element Rect
✔️ GET /session/{session id}/element/{element id}/enabled Is Element Enabled
✔️ POST /session/{session id}/element/{element id}/click Element Click
✔️ POST /session/{session id}/element/{element id}/clear Element Clear
✔️ POST /session/{session id}/element/{element id}/value Element Send Keys
✔️ GET /session/{session id}/source Get Page Source
POST /session/{session id}/execute/sync Execute Script
POST /session/{session id}/execute/async Execute Async Script
✔️ GET /session/{session id}/cookie Get All Cookies
GET /session/{session id}/cookie/{name} Get Named Cookie
✔️ POST /session/{session id}/cookie Add Cookie
✔️ DELETE /session/{session id}/cookie/{name} Delete Cookie
✔️ DELETE /session/{session id}/cookie Delete All Cookies
POST /session/{session id}/actions Perform Actions
DELETE /session/{session id}/actions Release Actions
POST /session/{session id}/alert/dismiss Dismiss Alert
POST /session/{session id}/alert/accept Accept Alert
GET /session/{session id}/alert/text Get Alert Text
POST /session/{session id}/alert/text Send Alert Text
✔️ GET /session/{session id}/screenshot Take Screenshot
GET /session/{session id}/element/{element id}/screenshot Take Element Screenshot
W3 compatible Method URI Template Constant
✔️ GET /session/{session id}/cookie GET_ALL_COOKIES
✔️ POST /session/{session id}/cookie ADD_COOKIE
✔️ DELETE /session/{session id}/cookie DELETE_ALL_COOKIES
✔️ DELETE /session/{session id}/cookie/{name} DELETE_COOKIE
✔️ POST /session/{session id}/element FIND_ELEMENT
✔️ POST /session/{session id}/elements FIND_ELEMENTS
✔️ POST /session/{session id}/element/{element id}/clear CLEAR_ELEMENT
✔️ POST /session/{session id}/element/{element id}/click CLICK_ELEMENT
GET /session/{session id}/element/{element id}/equals/:other ELEMENT_EQUALS
✔️ POST /session/{session id}/element/{element id}/element FIND_CHILD_ELEMENT
✔️ POST /session/{session id}/element/{element id}/elements FIND_CHILD_ELEMENTS
✔️ POST /session/{session id}/element/active GET_ACTIVE_ELEMENT
✔️ GET /session/{session id}/element/{element id}/attribute/{name} GET_ELEMENT_ATTRIBUTE
✔️ GET /session/{session id}/element/{element id}/css/{property name} GET_ELEMENT_VALUE_OF_CSS_PROPERTY
GET /session/{session id}/element/{element id}/location GET_ELEMENT_LOCATION
GET /session/{session id}/element/{element id}/location_in_view GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW
GET /session/{session id}/element/{element id}/size GET_ELEMENT_SIZE
✔️ GET /session/{session id}/element/{element id}/name GET_ELEMENT_TAG_NAME
✔️ GET /session/{session id}/element/{element id}/text GET_ELEMENT_TEXT
GET /session/{session id}/element/{element id}/displayed IS_ELEMENT_DISPLAYED
✔️ GET /session/{session id}/element/{element id}/enabled IS_ELEMENT_ENABLED
✔️ GET /session/{session id}/element/{element id}/selected IS_ELEMENT_SELECTED
✔️ POST /session/{session id}/element/{element id}/value SEND_KEYS_TO_ELEMENT
POST /session/{session id}/element/{element id}/submit SUBMIT_ELEMENT
✔️ DELETE /session/{session id}/window CLOSE
✔️ POST /session/{session id}/window SWITCH_TO_WINDOW
GET /session/{session id}/window_handle GET_CURRENT_WINDOW_HANDLE
GET /session/{session id}/window_handles GET_WINDOW_HANDLES
GET /session/{session id}/window/{windowHandle}/position GET_WINDOW_POSITION
GET /session/{session id}/window/{windowHandle}/size GET_WINDOW_SIZE
POST /session/{session id}/window/{windowHandle}/maximize MAXIMIZE_WINDOW
POST /session/{session id}/window/{windowHandle}/position SET_WINDOW_POSITION
POST /session/{session id}/window/{windowHandle}/size SET_WINDOW_SIZE
POST /session/{session id}/accept_alert ACCEPT_ALERT
POST /session/{session id}/dismiss_alert DISMISS_ALERT
GET /session/{session id}/alert_text GET_ALERT_TEXT
POST /session/{session id}/alert_text SET_ALERT_VALUE
POST /session/{session id}/execute EXECUTE_SCRIPT
POST /session/{session id}/execute_async EXECUTE_ASYNC_SCRIPT
✔️ POST /session/{session id}/frame SWITCH_TO_FRAME
✔️ POST /session/{session id}/url GET
✔️ GET /session/{session id}/url GET_CURRENT_URL
GET /sessions GET_ALL_SESSIONS
GET /session/{session id}/log/types GET_AVAILABLE_LOG_TYPES
POST /session/{session id}/log GET_LOG
✔️ GET /session/{session id}/source GET_PAGE_SOURCE
GET /session/{session id}/orientation GET_SCREEN_ORIENTATION
GET /session/{session id} GET_CAPABILITIES
✔️ GET /session/{session id}/title GET_TITLE
✔️ POST /session/{session id}/back GO_BACK
✔️ POST /session/{session id}/forward GO_FORWARD
POST /session/{session id}/buttondown MOUSE_DOWN
POST /session/{session id}/buttonup MOUSE_UP
POST /session/{session id}/click CLICK
POST /session/{session id}/doubleclick DOUBLE_CLICK
POST /session/{session id}/moveto MOVE_TO
✔️ POST /session NEW_SESSION
✔️ DELETE /session/{session id} QUIT
✔️ POST /session/{session id}/refresh REFRESH
POST /session/{session id}/file UPLOAD_FILE
POST /session/{session id}/keys SEND_KEYS_TO_ACTIVE_ELEMENT
POST /session/{session id}/timeouts/implicit_wait IMPLICITLY_WAIT
POST /session/{session id}/orientation SET_SCREEN_ORIENTATION
✔️ POST /session/{session id}/timeouts SET_TIMEOUT
POST /session/{session id}/timeouts/async_script SET_SCRIPT_TIMEOUT
✔️ GET /session/{session id}/screenshot SCREENSHOT
POST /session/{session id}/touch/click TOUCH_SINGLE_TAP
POST /session/{session id}/touch/down TOUCH_DOWN
POST /session/{session id}/touch/doubleclick TOUCH_DOUBLE_TAP
POST /session/{session id}/touch/flick TOUCH_FLICK
POST /session/{session id}/touch/longclick TOUCH_LONG_PRESS
POST /session/{session id}/touch/move TOUCH_MOVE
POST /session/{session id}/touch/scroll TOUCH_SCROLL
POST /session/{session id}/touch/up TOUCH_UP

Hi, here is my PR #599 with W3C support. It's not perfect but works with Firefox 60.x (https://travis-ci.org/facebook/php-webdriver/jobs/430392005) and latest Chrome. I don't know why it fails in SauceLabs, but fell free to try it and test it on your own.

This issue still persists for selenium 3.14. Getting the same console error while running the script.

commented

These changes would be very useful to me to get browser testing working in selenium/os x. I've checked out this pull request and it solves the w3c/enablePassthrough errors I was experiencing. Is there anything I can do to contribute? Is there a fork of php-webdriver that someone has created that has these features that I can install with composer in the meantime?

Still not working firefox with Selenium 3.141.59

Stopped working php-webdriver on Safari
Says [PHPUnit\Framework\Exception] Undefined index: ELEMENT on command $I->fillField $I->waitForText and $I->waitForElement

About a two weeks ago this commands working
Can you fix it?)
Thanks )

Looks like they dropped the legacy ELEMENT index recently:
https://bugzilla.mozilla.org/show_bug.cgi?id=1400233

The ELEMENT index was a legacy index and dropped in FF 63.0.

Hi folks,

Like others, I'm wondering what the go is with this project and support for Selenium3.

  • Is there an ETA for when this set of changes will land, or are we still stuck testing Firefox with ancient versions of Selenium and Firefox?
  • Is there anything we can do to help?
  • Is this just waiting for the spec to be finalised?
  • Is there an alternative project which has implemented the spec in its current form?

Thanks

@OndraM Is this project still alive?

Is there an alternative project which has implemented the spec in its current form?

I am asking because we're currently relying on the webdriver in conjunction with Codeception (PHP) and we need to make a decision if we should finally move over to CodeceptJS for acceptance tests.

Looks like they dropped the legacy ELEMENT index recently:
bugzilla.mozilla.org/show_bug.cgi?id=1400233

The ELEMENT index was a legacy index and dropped in FF 63.0.

Same issue on IE11 with the IEDriver.

Looks like they dropped the legacy ELEMENT index recently:
bugzilla.mozilla.org/show_bug.cgi?id=1400233
The ELEMENT index was a legacy index and dropped in FF 63.0.

Same issue on IE11 with the IEDriver.

I naively guess a similar (or the same?) problem with Chrome v75 (via https://github.com/SeleniumHQ/docker-selenium/releases/tag/3.141.59-palladium; the previous releases with Chrome and ChromeDriver v74 still worked), because while according to https://sites.google.com/a/chromium.org/chromedriver/downloads

The most noticeable change is ChromeDriver now runs in W3C standard compliant mode by default

... sounds like everything should still work when switching to non-W3C mode (please especially note the Detected dialect: OSS output instead of default Detected dialect: W3C):

13:20:00.890 INFO [ActiveSessionFactory.apply] - Capabilities are: {
  "browserName": "chrome",
  "goog:chromeOptions": {
    "args": [
      "--headless",
      "--disable-gpu",
      "--window-size=1920x1200"
    ],
    "w3c": false
  }
}
13:20:00.890 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770@{#40}) on port 22008
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1559827200.907][SEVERE]: bind() failed: Cannot assign requested address (99)
13:20:01.113 INFO [ProtocolHandshake.createSession] - Detected dialect: OSS
13:20:01.161 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 55234a7ec928b26e1dff81ea0b7cd803 (org.openqa.selenium.chrome.ChromeDriverService)
13:20:16.955 INFO [ActiveSessions$1.onStop] - Removing session 55234a7ec928b26e1dff81ea0b7cd803 (org.openqa.selenium.chrome.ChromeDriverService)

... the (Codeception v2.5.6) test then fails with Undefined index: ELEMENT (like in e.g. #492 or #576) => :-o or ;-(

Please mind that there is an UPDATE (Correction!) for this comment below: #469 (comment)

@andrewnicols thanks for your extremely fast and promising response => looking forward very much indeed...

@andrewnicols Oops, my comment #469 (comment) was not correct, sorry => see correction at the bottom

Ad "maintain a fork": yeah, I hope so; it looks as if there is enough demand and therefore potentially a group of interested devs around...

Ad "w3c: false for legacy mode" and correction of my comment: yes, that is what I actually tried, but it did not help me in my simple Codeception test for cookie policy (cookie policy banner ok button click hides the cookie policy banner):

  • when using default W3C protocol, then the Codeception (v2.5.6) test fails with Undefined index: ELEMENT (like in e.g. #492 or #576), in waitForElement() operation
  • when using legacy protocol, then the test succeeds for waitForElement() operation, which is followed by a seemingly also successful click() operation, but fails in the waitForElementNotVisible() operation by running into the default 10s timeout (when waiting for the hiding of the element due to the mouse click -- as if the click did not really happen or whatever)
    • frankly I am not sure why that happens, or if that could be actually another unrelated problem: it used to work ever since (that is at least since Chrome v70)
      • Update: It also/still works with Chrome v75, when using ChromeDriver v74!
      • Update#2: Seemingly Codeception's click() operation is translated into clickElement WebDriver command that is seemingly no more supported by ChromeDriver v75 (when using ChromeDriver in standalone mode without Selenium then the debug log just does not contain the expected COMMAND ClickElement output, so I guess it is silently ignored on arrival)!?
        • When using Codeception's clickWithLeftMouseButton() operation instead, it works again, as that is translated into (1) mouseMoveTo WebDriver command followed by (2) mouseClick WebDriver command -- that seemingly both are still supported...

Took me longer than I had hoped, but I've gotten to a point where most things are working in https://github.com/andrewnicols/php-webdriver/tree/fixtheworld

I still have a list of things not yet working (GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW is not available in W3C Webdriver for example) and I discovered that the window API has changed (now fixed). I need to go through the complete list of commands and check them off against the spec.

Hi everyone, sorry for not moving this issue forward in recent months :-(.

About the current issue with Chrome 75 - it enables W3C protocol by default. Unfortunately just disabling it wasn't enough to make it working again, as this change in Chromedriver introduced some bugs (@reinholdfuereder - this is why the click() command etc. didn't work). However I was able to find a workaround for the Chromedriver bug - see #640 . Because this issue affects lots of people and other projects (eg. laravel/dusk#651), the plan is to release this change ASAP as a new version.

And about future and full implementation of the W3C protocol. This project is definitely not dead. In next days, I will write down some ideas about future of the project and a ways how to get the W3C protocol implemented soon.

It's not secret this project requires some more maintainers to help with the W3C implementation and push it forward. I'm quite impressed by recent work of @andrewnicols on top of the #560 by @dunglas, great work! If you are interested, it would be great if I can include you and maybe others in this effort 🙏 .

I'm interested in working with @andrewnicols and you to merge W3C support as soon as possible. It's very important for Symfony / Panther. Let me know how I can help.
I'm also ok to help maintaining this lib.

Immediate fix for Chrome 75 has been released as part of php-webdriver 1.7.0.

Hi @OndraM,

I'm keen to help with this effort, and to share maintenance of the project.

Any chance you can share your plans and ideas for the future of the project?

Hey @OndraM ;

I'm interested of getting involved in this project.
Let me know how can I help.

Hi @OndraM, is there any chance that we can get the ball rolling again with this project?

We're all stuck in the dark ages testing with Firefox 47.0.1 and there are people like @dunglas (Symfony/Panther) and myself (Moodle) who would love to help get things moving.

Hi @OndraM, pinging again. We really need to do something with this project to make it compatible with W3C.

Hi again, I'm so sorry for the delays 😞 and really unhappy with not pushing this forward recently, but my time resources are limited and I needed to spend lot of work on other job-stuff.

But I've prepared request for comments for php-webdriver 2.0 - see #657 , and I invite everyone interested to check it out and comment. So that once I'm in a short while back from upcoming vacation, we can finally start the hard work. Thanks everyone!

📢 Current status update:

  • The experimental W3C protocol support (#560) was finally merged to community branch! Thanks @dunglas and others involved! 💯 💯 💯
  • If remote browser is capable of W3C protocol, it will now be automatically used instead of the old OSS JsonWireProtocol. This means eg. Chromedriver will now by default use W3C protocol. (This could still be disabled if you need to - see #674 (comment) )
  • This also means Geckodriver (ie. any new Firefox) could now be used! 🦊
  • Even though library code coverage is far from being ideal, we have passing Travis test builds for various browsers and protocol combinations: Latest Chrome with JsonWire protocol, with W3C protocol, via Selenium server, directly via chromedriver; Firefox 45/47 using JsonWire protocol, latest Firefox 67 using W3C protocol directly via Geckodriver binary and also via Selenium server... So lets hope we won't break much things 🍀 .

What needs to be mentioned again - the W3C protocol support is experimental (and will remain experimental in upcoming php-webdriver 1.8). Some parts (like capabilities) are not yet implemented to fully conform W3C WebDriver protocol. However most of the stuff should work.

What will be the process now:

  • Please test! You can easily update to the development version for the upcoming 1.8 release by changing dependency in your composer.json like this:
    "require": {
        "php-webdriver/webdriver": "^1.8@dev"
    }

and running composer update.
(Or you can just run composer require php-webdriver/webdriver:^1.8@dev).

  • If you encounter any issues, please report them!
  • This experimental W3C support will be released as part of php-webdriver 1.8, what should hopefully happen soon (if nothing bad happens).
  • Further steps towards future php-webdriver 2.0 are discussed in #657 . Also full support (not experimental) of W3C WebDriver will be part of php-webdriver 2.0.

🔥 🔥 🔥

The community branch now contains further W3C protocol-related improvements:

  • Capabilities are converted to W3C compatible ones
  • Some window-realted commands (set size, maximize etc.) were added to those supported in W3C protocol mode

🔔 Everyone please test the community branch and report issues!
composer require php-webdriver/webdriver:^1.8@dev

Hi @OndraM,

I tried using the community branch (facebook/webdriver:^1.8@dev) for running my tests on firefox latest version and I am able to open the firefox, load the page but the elements are not found. The same test works fine on chrome lastest version. Could you please help me in running the tests on latest firefox?

Platform: Linux
Firefox version: 71.0 (64-bit)
Selenium standalone server: 3.141.59
Gecko driver version: v0.24.0
PHP version: PHP 7.3.12 (cli)

behat.yml:

extensions:
   Behat\MinkExtension:
     default_session:  selenium2
     base_url: 'https://login.yahoo.com/'
     browser_name: firefox
     selenium2:
       capabilities:
         browser: firefox
         marionette: true
         version: ''

Composer.json:

"require": {
   "emuse/behat-html-formatter": "dev-master as 0.1.99",
   "behat/behat": "^3.4",
   "behat/mink-extension": "2.3.1",
   "behat/mink-selenium2-driver": "1.3.1",
   "phpunit/phpunit": "~7.1",
   "phpunit/phpunit-selenium": "~7.0",
   "monolog/monolog": "^1.22",
   "league/csv": "^8.2",
   "guzzlehttp/guzzle": "^6.3",
   "fzaninotto/faker": "@stable",
   "facebook/webdriver": "^1.8@dev",
   "php": "7.3.12"
 },

Starting selenium standalone server and gecko driver:

java -jar -Dwebdriver.gecko.driver=geckodriver selenium-server-standalone-3.141.59.jar

Test Feature:

  @testfirefox
  Scenario: Open yahoo mail and click forgot password
    When User launch Application
    And User click forgot password link

Step definition for User click forgot password link

  $this->wait(10);
  print_r($this->getSession()->getDriver()->click("//a[@id='mbr-forgot-link']"));
  $this->wait(10);

Test Output Error

(Element not found with xpath, //a[@id='mbr-forgot-link'] )

Note:

When I try to give
print_r($this->getSession()->getPage()->getContent());
I am getting the content.
But when I try to give
print_r($this->getSession()->getDriver()->getHtml("//html"));
I am getting the error (Element not found with xpath, //html )

Selenium Log:

 16:28:04.817 INFO [ActiveSessionFactory.apply] - Capabilities are: {
  "browser": "firefox",
  "browserName": "firefox",
  "ignoreZoomSetting": false,
  "marionette": true,
  "name": "Behat feature suite",
  "tags": [
    "LT00860",
    "PHP 7.3.12"
  ],
  "version": ""
}
16:28:04.818 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
1577118485007	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofileeS6Xv9"
1577118485605	addons.webextension.screenshots@mozilla.org	WARN	Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1577118485605	addons.webextension.screenshots@mozilla.org	WARN	Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1577118485605	addons.webextension.screenshots@mozilla.org	WARN	Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1577118485605	addons.webextension.screenshots@mozilla.org	WARN	Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
1577118487770	Marionette	INFO	Listening on port 39591
16:28:07.880 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
16:28:07.931 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 761450de-03e1-4b4a-a62c-8ae1144b57a5 (org.openqa.selenium.firefox.GeckoDriverService)
1577118498783	Marionette	INFO	Stopped listening on port 39591
16:28:20.497 INFO [ActiveSessions$1.onStop] - Removing session 761450de-03e1-4b4a-a62c-8ae1144b57a5 (org.openqa.selenium.firefox.GeckoDriverService)

@sathyas123 Even though you have installed php-webdriver, from what I understand, you are using mink-selenium2-driver - that means you don't actually use this library in your tests, as Behat uses its own, outdated Selenium JsonWire protocol implementation, see minkphp/MinkSelenium2Driver#293

However please report any further issues as a new standalone ticket here on Github, so that this thread don't get too flooded.

@OndraM, do you think that we may be able to release 1.8.0 shortly? I think we're nearly up to full compliance with the W3C spec (just a couple of missing commands which mostly have pull requests). Do you have a timeframe in mind?

No exact timeframe, but I've created 1.8.0 milestone to track reamining issues. There is just a few of them, so it should not take long. And I don't think we necessarily need full W3C compliance, this would be aim of 2.0. We just need "good enough" implementation in 1.8 :-).

📢 One more announcement for everyone watching this issue and waiting for W3C support.

As we move towards release 1.8.0, we successfully transferred the repository from Facebook (as explained in #730) and it is now available under new name. So in order to get any future updates of the package, you must update its name in require section of your composer.json file like this:

"require": {
-    "facebook/webdriver": "(version you use)",
+    "php-webdriver/webdriver": "(version you use)",
}

🎉 Version 1.8.0 was released!

Thanks to all 14 community contributors who made this possible (in 120 commits)! 🥇 ❤️

🆕 Have look at complete changelog.

Version 1.8.0 includes experimental support of W3C WebDriver protocol, and it will be used by default if your browser supports it (recommended is latest Chrome/Firefox). If you encounter any issues with the W3C protocol, you can still explicitly disable the protocol and use the legacy "JsonWire OSS protocol", but please also report the issue here on GitHub.

Also don't forget to rename the library in your composer.json:

"require": {
-    "facebook/webdriver": "...",
+    "php-webdriver/webdriver": "^1.8.0",
}

before you run composer update.

If you use Selenium standalone server, make sure to use the latest version (either stable 3.141.59 or you can try alpha version of Selenium 4) and remove no longer needed enablePassThrough workaround you might used previously.

Happy testing!