Upgrade 500 Selenium v3 tests to Selenium v4, Easy!
Selenium WebDriver Beta1 was released last month. I usually waited for the second Beta version, and the ruby releases are shown below.
To upgrade the test execution environment to use Selenium v4 is easy, just run the following command.
> gem install selenium-webdriver --version 4.0.0.beta2
In fact, that’s what I needed to do to upgrade the WhenWise regression suite. This is the beauty of WebDriver being W3C compliant.
Here are the steps I took to ensure that the WhenWise regression test suite works fine with Selenium v4.
Upgrade Selenium on the CT server, and trigger a run of all the Selenium WebDriver recipes (196 of them, from the book) on the BuildWise server, as a general check.
There was one error on the syntax change of starting Firefox with a custom profile; only a minor change is required. All WhenWise tests are set to run in Chrome, so no update is required.
2. Upgrade Selenium on my local machine, and run a few tests in the functional testing IDE (TestWise).
This step is optional. I want to make sure the tool is capable of debugging Selenium v4 tests, and being prepared to cope with test failures, if any, detected in the Continuous Testing process. It turned out I do need a minor update to TestWise to support the syntax with the introduction of relative locators. The latest TestWise 6.3 now supports Selenium v4.
3. Update Selenium on 9 build agents and trigger a CT build on the BuildWise CT server.
All tests (500 in the WhenWise regression suite) passed, a green build! Done.
Summary
Selenium WebDriver v4 is reliable for production use, and the upgrade is straightforward.
It has been 4.5 years since Selenium 3 Beta, and people would assume a considerable effort to upgrade a large test suite. The reasons for the upgrade process are so simple (pretty much just one command):
W3C standard.
This means that the API (designed by the top web experts in the world) is stable and has excellent backward compatibility.My Testing Tool (TestWise) is not tied to a specific testing library or version.
My CT Tool (BuildWise server + agents) is not tied to a specific testing library or version.
ChromeDriver works the same way as Selenium v3
High-quality Selenium WebDriver library, which is not surprising. Selenium is developed is based on standard (vs some ad-hoc changes introduced by programmers in proprietary tool vendors) and supported by all major browser vendors.
You will be awarded for doing things right.
I will write a separate article with example tests using new Selenium v4 features such as taking a screenshot of a specific web element and relative locators.