Selenium 4.20 Released!

Today we’re happy to announce that Selenium 4.20 has been released!

We’re very happy to announce the release of Selenium 4.20.0 for Javascript, Ruby, Python, .NET, Java and the Grid! Links to everything can be found on our downloads page.

Highlights

  • Chrome DevTools support is now: v122, v123, and v124 (Firefox still uses v85 for all versions)
  • Selenium has at least 2.3M active users in the last 30 days. 500k more than last month!
  • Java and JavaScript keep adding more WebDriver BiDi features.
  • .NET C# and JavaScript now publish nightly builds to GitHub packages.
  • Nightly packages are tested daily with the examples from the Selenium documentation.
  • The code used to invoke Selenium Manager has been refactored in all languages, making it easier to maintain and improve.
    • The interface has changed and if users were invoking it, they might experience issues. Selenium Manager is still in beta and these type of changes are expected.

Noteworthy changes per language

  • Java
    • Browser containers provisioned in Dynamic Grid will use the hostConfig
    • Dynamic Grid re-fetches browser images if they were pruned during runtime
    • Several BiDi additions: Update browsing context create method, between others.
    • See all changes

  • JavaScript
    • Several BiDi additions: Update capture screenshot APIs to include all parameters and remove scroll parameter, between others
    • Nightly JS builds are now pushed to GitHub packages
    • See all changes

  • .NET
    • The correct devtools session id is now used after reinitialization
    • Nightly .NET C# builds are now pushed to GitHub packages
    • See all changes



Contributors

Special shout-out to everyone who helped the Selenium Team get this release out!

Selenium

Viet Nguyen Duc

Viet Nguyen Duc

Selenium Docs & Website

Viet Nguyen Duc

Viet Nguyen Duc

Agustin Pequeno

Agustin Pequeno

Harshit Bhardwaj

Harshit Bhardwaj

Andrew Zipperer

Andrew Zipperer

Docker Selenium

Viet Nguyen Duc

Viet Nguyen Duc

Maxim Manuylov

Maxim Manuylov

Selenium Team Members

Thanks as well to all the team members who contributed to this release:

Puja Jagani

Puja Jagani

Diego Molina

Diego Molina

Boni García

Boni García

Sri Harsha

Sri Harsha

Nikolay Borisenko

Nikolay Borisenko

Alex Rodionov

Alex Rodionov

Simon Stewart

Simon Stewart

Titus Fortner

Titus Fortner

David Burns

David Burns

Stay tuned for updates by following SeleniumHQ on X (Formerly Twitter) or LinkedIn!

Happy testing!

Selenium 4.19 Released!

Today we’re happy to announce that Selenium 4.19 has been released!

We’re very happy to announce the release of Selenium 4.19.0 for Javascript, Ruby, Python, .NET, Java and the Grid! Links to everything can be found on our downloads page.

Highlights

  • Chrome DevTools support is now: v121, v122, and v123 (Firefox still uses v85 for all versions)
  • Thanks to Selenium Manager’s records usage, we know Selenium has at least 1.8M active users in the last 30 days!
  • Java and JavaScript keep adding more WebDriver BiDi features.
  • The WebDriver BiDi features in Java have a new home, read it at Puja’s blog post.

Noteworthy changes per language

  • Java
    • se:bidi was removed from the session response when starting a Grid session, as webSocketUrl is enough.
    • Memory allocation and thread handling was improved in Grid.
    • Add missing event handlers for TargetLocator interface in WebDriverListener.
    • Several BiDi additions: adding setFiles command of the Input Module, between others.
    • See all changes

  • JavaScript
    • Several BiDi additions: adding setFiles command of the Input Module, between others.
    • See all changes

  • .NET
    • The ChromiumDriverService.AllowedIPAddresses name was corrected
    • It is now possible to set timeouts via capabilities
    • See all changes

  • Python
    • More network interfaces were added to detect lan ip
    • The install_addon() (Firefox extensions) was improved to take into account dir paths with trailing slashes
    • Improvements for type parameters
    • See all changes


  • Rust
    • Improving how MS Edge is downloaded
    • Fix how MS Edge is managed in RPM-based Linux
    • See all changes

Contributors

Special shout-out to everyone who helped the Selenium Team get this release out!

Selenium

Adam Dangoor

Adam Dangoor

Agustin Pequeno

Agustin Pequeno

Scott Babcock

Scott Babcock

Jani Hautakangas

Jani Hautakangas

Selenium Docs & Website

Amar Deep Singh

Amar Deep Singh

Mohammad Monfared

Mohammad Monfared

Docker Selenium

Viet Nguyen Duc

Viet Nguyen Duc

Cedric Roijakkers

Cedric Roijakkers

Maxim Manuylov

Maxim Manuylov

Mårten Svantesson

Mårten Svantesson

Selenium Team Members

Thanks as well to all the team members who contributed to this release:

Puja Jagani

Puja Jagani

Diego Molina

Diego Molina

Boni García

Boni García

Sri Harsha

Sri Harsha

Nikolay Borisenko

Nikolay Borisenko

Alex Rodionov

Alex Rodionov

Simon Stewart

Simon Stewart

Titus Fortner

Titus Fortner

David Burns

David Burns

Stay tuned for updates by following SeleniumHQ on X (Formerly Twitter) or LinkedIn!

Happy testing!

Update imports to use BiDi Java

This blog post discusses the rationale behind the breaking change in Java BiDi implementation and the changes users will have to make.

What part of the code base is impacted?

Selenium WebDriver BiDi APIs in Java bindings are impacted.

What is impacted by the breaking change?

The WebDriver BiDi APIs stay as they are, so you can continue to use them. However, the import statements need to be updated.

What is the breaking change?

The import statements need to be updated when using the BiDi APIs.

Before Selenium 4.19:

import org.openqa.selenium.bidi.LogInspector;
import org.openqa.selenium.bidi.BrowsingContextInspector;
import org.openqa.selenium.bidi.Input;
import org.openqa.selenium.bidi.Script;
import org.openqa.selenium.bidi.Network;

After Selenium 4.19 and above:

import org.openqa.selenium.bidi.module.LogInspector;
import org.openqa.selenium.bidi.module.BrowsingContextInspector;
import org.openqa.selenium.bidi.module.Input;
import org.openqa.selenium.bidi.module.Script;
import org.openqa.selenium.bidi.module.Network;

Why the breaking change?

Selenium is actively working to implement the W3C BiDi. The long-term goal of W3C BiDi is to port all W3C WebDriver Classic APIs to use the WebDriver BiDi APIs under the hood. When browsingContext.locateNodes command, which is the BiDi counterpart of findElements command, was introduced, the major goal was to ensure that the ’locateNodes’ command returns a WebElement. This would be make the porting smoother in the future and allows users to continue calling APIs of the WebElement.

During the implementation, a circular dependency was encountered in the underlying build tool Bazel. The solution to this was to follow the best practices of Bazel.

So, the W3C BiDi related classes of a module were grouped into Bazel package. The classes that themselves call commands or events were all grouped under a package named ‘module’. Thus, following the recommended practice and avoiding Bazel’s circular dependency proved to be a win-win solution.

Summary

The W3C BiDi protocol is in under development, and parallelly browsers and clients are working to add the complementary APIs. While Selenium works on implementing it, the protocol is constantly changing, with new modules or APIs being added or existing ones being updated. While the team strives to avoid breaking changes and deprecate APIs for at least 2 versions before removal, it can be challenging to adhere to this for some changes, such as the one described in this blog post.

Selenium 4.18 Released!

Today we’re happy to announce that Selenium 4.18 has been released!

We’re very happy to announce the release of Selenium 4.18.0 and 4.18.1 for Javascript, Ruby, Python, .NET, Java and the Grid! Links to everything can be found on our downloads page.

Highlights

  • Chrome DevTools support is now: v120, v121, and v122 (Firefox still uses v85 for all versions)
  • Selenium Manager records usage has been decreased to reduce impact on users.
  • Chrome headless changed the name of the browser to reflect that it is not actually chrome; Selenium now handles this seamlessly, but you should still switch to --headless=new (see: Headless is going away)

Noteworthy changes per language

  • Java
    • Enabling Grid to use self-signed certificate for debugging
    • Added explicit target locator events to the listener support classes in WebDriverListener.
    • Add missing event handlers for TargetLocator interface in WebDriverListener.
    • Several BiDi additions: Browsing context destroyed event, Network intercept commands, command continuewithAuth, between others.
    • See all changes

  • JavaScript
    • Several BiDi additions: Browsing context destroyed event, realm destroyed event, command continuewithAuth, between others.
    • See all changes

  • .NET
    • Fix protocol cdp version for RemoteWebDriver.
    • Fix network response data encoding.
    • Explicitly support passing the full path to driver in Service constructor
    • See all changes



  • Rust
    • Add timestamps to Selenium Manager logs
    • Selenium Manager decreases frequency of statistics reporting
    • See all changes

Contributors

Special shout-out to everyone who helped the Selenium Team get this release out!

Selenium

Oscar Devora

Oscar Devora

Manuel Blanco

Manuel Blanco

Oleg Ridchenko

Oleg Ridchenko

Simon Perepelitsa

Simon Perepelitsa

Simon K

Simon K

Valery Yatsynovich

Valery Yatsynovich

Selenium Docs & Website

Michal Nowierski

Michal Nowierski

Mohammad Monfared

Mohammad Monfared

我的饭

我的饭

Nikolay Borisenko

Nikolay Borisenko

Docker Selenium

Selenium Team Members

Thanks as well to all the team members who contributed to this release:

David Burns

David Burns

Boni García

Boni García

Diego Molina

Diego Molina

Sri Harsha

Sri Harsha

Nikolay Borisenko

Nikolay Borisenko

Alex Rodionov

Alex Rodionov

Puja Jagani

Puja Jagani

Simon Stewart

Simon Stewart

Titus Fortner

Titus Fortner

Stay tuned for updates by following SeleniumHQ!

Happy testing!

Selenium 4.17 Released!

Today we’re happy to announce that Selenium 4.17 has been released!

We’re very happy to announce the release of Selenium 4.17.0 for Javascript, Ruby, Python, .NET, Java and the Grid! Links to everything can be found on our downloads page.

Highlights

  • Chrome DevTools support is now: v119, v120, and v121 (Firefox still uses v85 for all versions)
  • Selenium Manager records usage set environment variable SE_AVOID_STATS to "true" to avoid sending information.
  • Chrome headless changed the name of the browser to reflect that it is not actually chrome; Selenium now handles this seamlessly, but you should still switch to --headless=new (see: Headless is going away)

Noteworthy changes per language

  • Java
    • Remove deprecated event listener classes; update to EventFiringDecorator and WebDriverListener classes
    • Allow disabling Grid UI
    • Deprecated FirefoxBinary class and legacy Error Codes
    • Deprecated HTML5 features for offline storage, location, and network connection
    • No longer accepting session requests with desiredCapabilities keyword
    • See all changes

  • JavaScript
    • Remove deprecated headless methods and associated references
    • Implemented remote file downloading
    • See all changes

  • .NET
    • Improvements to the new logging implementation
    • Removed previously deprecated code
    • See all changes

  • Python
    • Updated WPEWebKit support
    • Removed previously deprecated code
    • Deprecated FirefoxBinary and several outdated FirefoxProfile methods
    • See all changes


  • Rust
    • Use latest browser from cache when browser path is not discovered
    • Throw a descriptive message when error parsing JSON from response
    • See all changes

Contributors

Special shout-out to everyone who helped the Selenium Team get this release out!

Selenium

Andrei Solntsev

Andrei Solntsev

James Braza

James Braza

Lauro Moura

Lauro Moura

Valery Yatsynovich

Valery Yatsynovich

Viet Nguyen Duc

Viet Nguyen Duc

Henrik Skupin

Henrik Skupin

Selenium Docs & Website

Oscar Devora

Oscar Devora

Yevgeniy Shunevych

Yevgeniy Shunevych

Docker Selenium

Auto81

Auto81

Amar Deep Singh

Amar Deep Singh

Viet Nguyen Duc

Viet Nguyen Duc

Selenium Team Members

Thanks as well to all the team members who contributed to this release:

David Burns

David Burns

Boni García

Boni García

Diego Molina

Diego Molina

Sri Harsha

Sri Harsha

Nikolay Borisenko

Nikolay Borisenko

Alex Rodionov

Alex Rodionov

Puja Jagani

Puja Jagani

Titus Fortner

Titus Fortner

Stay tuned for updates by following SeleniumHQ!

Happy testing!

Selenium Vs … blog posts

This blog post discusses the click bait posts out there comparing selenium, cypress, and playwright. How none of these are meaningful or helpful.

The easiest way to clickbait a blog post about automated testing is to compare Selenium against another tool in the space with a catchy title especially when it talks down about the incumbent.

Unfortunately, this can lead to muddying the waters of which features are available in any of the products out there especially when we compare apples to apples.

Selenium has always been a great tool for browser automation. Fortunately for the project, it has become the tool of choice for testing web applications for nearly 2 decades. The area this project has focused on is building out the hard parts of browser automation that are increasingly difficult. Stable APIs and scalability of the infrastructure to run Selenium has always been the priority of the project. It hasn’t focused on how people test with it because there are very good test frameworks out there and having to do it for 5 different languages is a non-trivial amount of engineering effort.

However, some particular misconceptions regularly reappear across these blog posts.

It’s too hard to set up browsers and drivers compared to Playwright and Cypress

This used to be true in the past as you had to download the drivers. This wasn’t too bad for GeckoDriver and SafariDriver as they could handle browser upgrades gracefully. On the other hand, you need to update the drivers for Chromium-based browser for every new release.

For over a year now, Selenium handles this automatically. If it can’t find a ChromeDriver or EdgeDriver, it will download it using Selenium Manager. Since its first release it has improved a lot and it is now probably the best in class since the latest versions of Selenium will even download browsers if it can and use that. Compared to Playwright and Cypress you don’t need to update your dependency on Selenium to update browsers and drivers, you still use the same browsers as your customers, and switching versions becomes a breeze: you don’t also have to change the test framework you’re using. And, let’s not forget that it uses the browser that Google recommends you use for testing.

Setting up a test runner is hard work where Playwright and Cypress have it built in…

Well… maybe? Setting up E2E test frameworks with Selenium isn’t as difficult as some might suggest. The hard part really is making sure that the driver is in the right place and we’ve solved that as discussed above. Once that’s done, Selenium’s approach allows you to use whichever test runner you’re most comfortable with. If you’d like a “batteries included” approach, with Selenium tightly integrated with the test runner, then one of the many projects that use Selenium, such as SeleniumBase, Nightwatch, Serenity, and so on, might be the right tool for you.

One thing to note is that Playwright is the only multi-language browser automation framework like Selenium. However, if you don’t use TypeScript or JavaScript you will still need to do the setup of the test runner yourself. Some testing frameworks have plugins that automatically set up the fixtures you might need. In the JavaScript/TypeScript space if you really need a built-in test runner there are downstream projects like NightwatchJS and tangential projects like WebdriverIO. Downstream projects use our libraries and tangential projects have their own libraries but still follow the WebDriver standard.

Playwright and Cypress can do network interception and allow me to write event-driven code unlike Selenium

Selenium has been able to offer this since Selenium 4 came out. It’s so good that even Playwright suggest you use it for scaling your tests. The Selenium Project won’t be removing this anytime soon as we are dependent on WebDriver BiDi specification being implemented for those features to replace them. Even then Selenium has a history of trying to make sure that upgrades don’t break anything without sufficient warning. It’s why each language provides high-level wrappers, such as the NetworkInterceptor, that isolate your tests from the underlying technology being used.

Summary

As we have seen from the above Selenium is still as good as the products out there. One thing that is different for Selenium from Cypress or Playwright is that we’re a volunteer-driven project and not commercially backed. Want to help us out? Why not write a blog post about how you’re using the features above or post on social media how these features make your lives easier?