tebeka / selenium

Selenium/Webdriver client for Go
MIT License
2.53k stars 409 forks source link

Need to add support for W3C variant of WebDriver protocol #51

Closed DrMarcII closed 7 years ago

DrMarcII commented 7 years ago

The W3C WebDriver spec is getting close to CR status, and some endpoints (notably GeckoDriver and EdgeDriver) will only support the new spec. There are some changes that will need to be made to this project to make it work as this transition is made, most notably:

  1. responses no longer include a status field. Instead they include an error field with a text value if an error occurs.

  2. The various low-level actions endpoints (e.g. keyboard and mouse actions) are no longer supported. Instead a single actions endpoint is defined that takes a message representing a sequence of keyboard, mouse, and touch screen actions.

minusnine commented 7 years ago

Acknowledged. I will get to this soon, hopefully this week.

minusnine commented 7 years ago

I'm working through this now.

Do you happen to know if there is a recommended way to interrogate the remote to decide on what dialect to use? I'd like to maintain compatibility to allow this client to be used by both Selenium 2 and 3 (for a period of time).

Otherwise, I can deduce W3C spec compliance from the presence or absence of particular methods. Or, I'll ask the Selenium folks.

DrMarcII commented 7 years ago

See https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java for how Selenium does this in Java.

minusnine commented 7 years ago

That commit supports the latest nightly of Firefox through Geckodriver. As detailed in the README.md, there are a bunch of outstanding issues.

What I've learned is that adding W3C compatibility is more of a process than a single task.

I'll keep tabs on the issues linked there and continue to update this code.