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

Selenium 4 support #373

Closed
AlexSkrypnyk opened this issue Oct 16, 2023 · 8 comments
Closed

Selenium 4 support #373

AlexSkrypnyk opened this issue Oct 16, 2023 · 8 comments

Comments

@AlexSkrypnyk
Copy link

Selenium 2 was released 7 years ago.

Official Selenium docker images with inbuilt Chrome starting version 112 dropped support for non-W3C compliant API. This means that it is no longer possible to use this Selenium 2 driver as-is with newer versions of Selenium.

Non-W3C session creation example:

curl -X POST http://localhost:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName":"chrome"}}' -H "Content-Type: application/json"

W3C session creation example:

curl -X POST http://localhost:4444/wd/hub/session -d '{"capabilities": {"firstMatch": [{"browserName": "chrome"}]}}' -H "Content-Type: application/json"

As one can see, there are no more desiredCapabilities and the config structure was changed.

If one uses friends-of-behat/mink-extension, version 2.7.3 added support to provide Selenium 4 driver support.

There is now a fork of this repo into Selenium 4 Driver - https://github.com/eDiasoft/MinkSelenium4Driver

Currently, there are many projects keep using the old Selenium 2 setup because it is not clear what the upgrade path looks like.

@stof
Could you please summarise what the community should expect from this specific repository - will it be updating to support Selenium 4 (will the name stay?), or will the community need to look at alternatives (like the fork specified above)? Or such compatibility layer lies in another package, like instaclick/web-driver?

Thank you

p.s. Sorry to tag you like this and raising it here. It took me about half of day to get my head around all these dependencies, deprecations and inter-version configuration changes. There is not much information about all of this in one place. I was hoping you could share you knowledge about this here so that others would not have to search through many many places. Thanks again

@stof
Copy link
Member

stof commented Oct 16, 2023

We have started the work on a new driver at https://github.com/minkphp/webdriver-classic-driver that will use a different webdriver library to have better support for the W3C webdriver protocol. the work is not done yet though (for now, most of the work is in a PR).

@uuf6429
Copy link
Member

uuf6429 commented Feb 22, 2024

I think this issue can be closed, now that the WIP PR has been merged.

@AlexSkrypnyk
Copy link
Author

@uuf6429
Could you please provide more information about which exact "WIP PR" you are talking about.

@uuf6429
Copy link
Member

uuf6429 commented Feb 22, 2024

@AlexSkrypnyk when Christophe wrote that comment, I think he meant this PR: minkphp/webdriver-classic-driver#1
It has been merged late last year, which means that that driver can actually be used (albeit in a pre-release stage).

Does this answer the question(s) from this issue?

@AlexSkrypnyk
Copy link
Author

The ask in this ticket was to summarise the steps one needs to take to make the driver work with Selenium 4.

I still do not understand what the whole solutions looks like and would appreciate some extended information.

@aik099
Copy link
Member

aik099 commented Feb 25, 2024

@AlexSkrypnyk , this driver (https://github.com/minkphp/MinkSelenium2Driver) can't work with Selenium 4.

But the https://github.com/minkphp/webdriver-classic-driver driver can. I've added a sample PHP code in the minkphp/webdriver-classic-driver#13.

@AlexSkrypnyk
Copy link
Author

@aik099
Thank you
I will move any further discussions into minkphp/webdriver-classic-driver.

@aik099
Copy link
Member

aik099 commented Feb 26, 2024

Discussion moved to minkphp/webdriver-classic-driver#13 (comment) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants