This past October at the Selenium Conference in Chicago, Simon Stewart announced that Selenium 4 will be released by Chinese New Year. With this new version of Selenium comes support for the W3C protocol. Many testing teams are wondering how this will affect their current Selenium scripts. To help with the transition, we have put together a list of frequently asked questions.
Why is this happening?
There are three main advantages to the W3C protocol:
- There will be an agreed-to standard that all browser vendors will develop to so your tests should be run more consistently between browsers
- The standard protocol has been developed with stability in mind, so Selenium tests in general will be more stable
- The Actions API has been updated and is far richer than what was in the JSON Wire protocol
You can read more of the spec for detailed changes.
Do I have to change my tests?
The good news is that no changes to Selenium Test Scripts need to be made to run with the W3C protocol. The W3C protocol interprets standard Selenium commands and runs these appropriately.
Will my tests still run on the Sauce Labs platform?
While you don’t need to make any changes at the test level, current Sauce users will need to make adjustments to the way they invoke Sauce-specific commands in order to use them with the W3C protocol. Sauce-specific Selenium commands are ones that work outside the W3C protocol but provide enhanced features for tests such as: specifying browser versions, initiating secure tunnels, Extended Debugging etc.
How do I update these commands?
To use Sauce-specific commands with the W3C protocol you need to invoke the new sauce:options command, at a global, setup level. Selenium will then interpret the commands appropriately and apply them to all the tests that follow.
When does this take effect?
Sauce Labs already supports the W3C protocol when you use the sauce:options command in your setup (Selenium v3.141.59 up to the latest version). With the upcoming Selenium 4 release, browser vendors will default to the W3C protocol. So, to future proof your tests, we recommend testing on W3C protocol with our sauce:options capability as soon as possible.
Sauce Labs is here to help
As mentioned above, Sauce Labs already supports the W3C protocol. We are encouraging our users to start testing out the new sauce:options capabilities, and let us know what they think. To help make this transition smoother, we have created a public GitHub repo with code snippets for sauce:options that you can copy/paste into your own tests. Try them out, and let us know what you think by getting into contact with our Product Team.
Win a Free Ticket to SauceCon!
If you visit the sauce:options GitHub repo, you might notice that there are still some browsers and frameworks that are missing. Our team is hard at work filling this out, but we want help from our fellow testing community members (hey, that’s you!). Submit your own pull request with a code snippet that isn’t already posted in the repo, and if yours is accepted we will send you a Sauce Labs swag pack. On top of that, everyone who submits an accepted pull request will be entered to win a free ticket to SauceCon (conference only ticket, airfare and lodging not included). Currently an $899 value, this is a great opportunity to get into one of the hottest testing conferences of 2019.