Selenium 4: Improved grid, new features for testers



Selenium is the most widely used software for automating user interface testing, and although some argue that it is fuzzy and not easy to manage dependencies, the project has found its way into many development labs.

Last month saw the release of Selenium 4, which Simon Stewart, former head of the open source Selenium project, said introduced “a lot” of new features and bugfixes, both from a tester’s perspective. using Selenium to automate a browser and from an enhanced Selenium grid.

For testers using Selenium, new features include “relative locators”, which allow the tester to describe where an item is on a page using human language, such as “above that item” or “to the right of this, explained Stewart, who resigned from his post on Oct. 27. The release adds support for handling authentication, intercepting and removing network traffic, and catching JavaScript errors. .

Additionally, there is new out-of-the-box chrome-based Edge support. “When we released the latest version of Selenium 3, that browser didn’t even exist,” Stewart told SD Times. He added that the project team cleaned up the internals of Selenium itself, allowing code-based work to proceed quickly. “It’s not often that a project has a chance to pay off technical debt,” said Stewart.

Stewart described the Selenium Grid update as “a fundamental rewrite of what we had in Selenium 3”. This includes built-in support for the use of Docker containers and adds a “fully distributed” mode, designed to facilitate the deployment of large grids in environments such as Kubernetes, he said, to accompany the support. supports the original “stand-alone” and “hub and node” versions.

Grid has a new user interface on top of a GraphQL backend and offers live views of tests running on the grid. This, Stewart explained, “is a remarkably useful thing to be able to do. Of course, modern system administrators don’t just rely on an application’s user interface to determine if everything is working as it should, so we’ve made the grid “observable” using… the OpenTelemetrty APIs. This allows you to use tools such as Jaeger or Honeycomb to dig inside each application.

Stewart heard critics say that Selenium requires special expertise to operate, that it is difficult to scale and requires a lot of maintenance, and responded by saying, “I would suggest that the Selenium grid is not over. complex or complicated that any distributed system you may want to deploy on Kubernetes, and the support that those applications need is the support that the grid will need. Asking a QA team to deploy and manage this type of application is probably too much of a challenge, as it would be asking them to manage your production applications in Kubernetes. He went on to say that “The Selenium Grid is like any distributed system you want to run in your business – when things are working fine, you are fine, but debugging issues can take time and specialist skills.

He noted that the project tried to reduce this kind of burden through support for observability, which helps teams keep up with the rapid release schedules of modern browsers. “This is why ‘Selenium-as-a-Service’ providers, such as SauceLabs and BrowserStack, are so popular. Even projects competing with Selenium Grid try to direct people to centralized systems that they maintain for you.

Observability also makes it easier to diagnose problems, said Stewart. Each of the grid components has a clear REST-based API that can be implemented however the user prefers. The in-memory implementations of these are part of the core Selenium 4 distribution, and they are database-based or Redis-based implementations of the stateful parts of the system, which had not been done before.

While Selenium offers automated browser testing, Stewart said, “I don’t think we can ever remove people from the mix, no matter which test library we use, especially if the test needs to be written before the software was not developed ”, as in the teams practicing test-driven development.

Stewart explained, “I’ve seen people try to automate the generation of page objects, and these usually end up mapping the input elements to the object’s properties. with ‘loginPage.setUsername (“admin”); loginPage.setPassword (“admin”) ‘. That is, expressiveness and clarity has been sacrificed for the convenience of generating the page object, and since the real cost of a test is in understanding and maintaining it, I think that’s is a false economy.

“On the other hand,” he continued, “computers are really good at generating and running exhaustive examples and inputs. I have seen some very creative uses of Selenium which spider a site and attempt to spam any forms they come across, or which ensure that the “tab index” (the order in which form elements are concentrated when people click on the “tab” key) makes sense. For these kinds of tests, I much prefer to rely on a stand-alone test rather than a written human test.

To get started with Selenium itself, there are many resources, such as those offered by Test Automation University.. The Selenium site has documentation in multiple languages ​​for using Selenium. More immediate help can be found in the project’s Slack channel, where the main developers are often online to answer questions and offer advice.


Previous Do your part to save water: reset your sprinkler system back to once a week
Next Cherokee High School Gymnasium unusable due to deformed floor