![](https://www.browserstack.com/blog/content/images/2024/07/Blog-4-1.png)
Selenium 4.22.0 was released on June 21st, 2024, coinciding with the online Selenium Conference 2024! This year's conference was special since it celebrated 20 years of Selenium by bringing together insights from Selenium creators, a wonderful speaker lineup, and a leadership panel with all Selenium sponsors.
With each release, our focus is to make the lives of our end users easier. Whether you are a developer, tester, or project manager, you will find valuable insights in this post to enhance your testing journey.
Download the latest release
You can download the 4.22.0 release here.
Bug Fixes 🐛
Javascript
- Revived Javascript API docs: The Javascript API docs were not being generated correctly for a while. It is now fixed and the documentation is as good as new.
- Refined typing for WebDriver BiDi events related to user prompts: You can now retrieve all the fields of “user-prompt closed” and “user-prompt-opened” events accurately.
Python
- Resolved end-of-file errors: Address issues where end-of-file errors occurred specifically during .zip file downloads. Users can now pass in file names without “.zip” extension and it will work seamlessly.
- Fixed session creation for WebKitGTK driver: Unsupported keywords such as "desired-capabilities" are no longer included when using RemoteWebDriver, preventing errors and ensuring correct session creation.
Features ⭐
Java
- Implemented a convenience method to enable WebDriver BiDi in the Options class. Users can now enable BiDi without needing to know the correct capability keyword. Example:
ChromeOptions options = new ChromeOptions();
options.enableBiDi();
- Users can now set the capability
se:videoName
to control the video record file name in dynamic Grid. Ifse:videoName
is not explicitly set, it will default to using the value ofse:name
. This provides flexibility in how video recordings are named.
Javascript
- Implemented high-level BiDi logging APIs: Developers can now easily manage handlers to monitor console messages and JavaScript exceptions using Webdriver BiDi. Example:
await driver.script().addJavaScriptErrorHandler(callback)
Python
- Allowing enabling WebDriver BiDi in the Options class. Example:
options.enable_bidi = True
- Introduced synchronous support for lower-level DevTools/CDP API: This allows direct interaction with DevTools/CDP through synchronous methods. This is essentially the groundwork required for future enhancements with higher-level API integrations. Example usage:
devtools, connection = driver.start_devtools()
console_api_calls = []
connection.execute(devtools.runtime.enable())
connection.on(devtools.runtime.ConsoleAPICalled, console_api_calls.append)
- Implemented high-level BiDi logging APIs: Developers can now easily manage handlers to monitor console messages and JavaScript exceptions using Webdriver BiDi. Example:
log_entries = []
driver.script.add_console_message_handler(log_entries.append)
Ruby
- Achieved language parity with Java and Javascript bindings by adding support for setting the “silent” option in Internet Explorer.
- Implemented high-level BiDi logging APIs: Developers can now easily manage handlers to monitor console messages and JavaScript exceptions using Webdriver BiDi. Example:
log_entries = []
driver.script.add_console_message_handler { |log| log_entries << log }
Enhancements 📈
Java
- Enhanced debugging in Grid by logging complete exceptions during the WebDriver startup, and session creation. Also, added logging for unsuccessful session creation attempts.
- We have resolved potential memory leaks by ensuring proper thread closure for UrlChecker, which is critical during WebDriver startup.
Ruby
- Improved type Introduced RBS files to aid type hinting and improve IDE compatibility. More RBS files will be added incrementally in the upcoming version. This will enhance code navigation in IDEs like RubyMine.
C#
- Introduced asynchronous methods in .NET bindings: This is the groundwork for future BiDi APIs. Synchronous methods will continue to be supported meanwhile, they will be calling the underlying asynchronous implementations. This enhancement started by adding asynchronous to the Navigation class.
Rust
- Improved error tracing functionality by displaying driver path when the driver is unavailable.
- Selenium Manager now offers a "mixed" output mode, logging real-time messages to stderr and providing a summary of driver and browser path on completion.
Deprecations ❌
Although not a deprecation from our end, Firefox is planning to eventually deprecate its ChromeDevTools Protocol support. To mitigate the potential impact on users, Selenium has set the recommended Firefox preference to a value that allows using both ChromeDevTools protocols and WebDriver BiDi. This change is made across all language bindings.
Conclusion
Maintaining an open-source project is challenging. While this blog focuses on high-level changes that directly benefit end users, it takes a lot of work behind the scenes, including performance improvements, CI updates, minor fixes, documentation enhancements, build optimizations, and much more. For a detailed view of all changes, visit the Selenium release comparison.
Driven by over 4 years of dedicated engineering involvement in the Selenium project, BrowserStack has also become a Development partner. We look forward to continuing our commitment to the Selenium community.
Happy Testing!