Selenium allows teams to run their test scripts reliably across different browsers and environments. As web platforms evolve, Selenium also adds new features and cleans up old APIs to stay current.
Overview
What is the Latest Version of Selenium?
The latest version of Selenium is 4.33.0, released in May 2025.
What’s New in Selenium 4.33.0?
Selenium 4.33.0 introduces several key improvements and new features, including:
- Better Grid View: You can now see live node activity and more details about running test sessions.
- Improved BiDi Support: A new webExtension module allows deeper access to browser features like console messages and network traffic.
- Updated Chrome Support: Works with the latest version of Chrome (137) for smoother test execution.
- Bidirectional APIs: Enable two‑way communication between test scripts and the browser for advanced debugging and performance monitoring.
This article explains the latest Selenium 4 features in detail.
What’s new in Selenium WebDriver 4?
Selenium 4 adopts the W3C WebDriver standard to ensure test execution is more stable across browsers. The Grid has a new interface and better tools for managing test sessions across machines. New relative locators find elements based on their position relative to nearby elements, making test scripts simpler and more readable.
It adds built‑in Chrome DevTools support. This gives direct access to console messages, network traffic, and performance data, speeding up debugging and inspection. The Selenium 4 IDE now works with more browsers, which makes recording and creating test scripts smoother.
The Actions class has new methods for advanced mouse and keyboard interactions. Old and deprecated methods have been removed to reduce clutter and make the APIs more predictable.
Read More: Selenium 3 vs Selenium 4: Core Differences
Features of Selenium 4
Selenium 4 is now more modern and developer‑friendly. It introduces core changes that make the tool more flexible and easier to work with.
1. W3C WebDriver Standardization
Selenium 4 switched entirely to the official W3C WebDriver standard. Earlier versions of Selenium used JSON Wire Protocol, which worked but caused inconsistencies between browsers. Each browser had its own way of interpreting commands. This meant test scripts often had to be adjusted to run reliably across Chrome, Edge, Firefox, or other browsers.
The W3C standard eliminates these inconsistencies. All browsers now understand and respond to WebDriver commands the same way. This makes test automation more predictable. Scripts run reliably across environments, and you spend less time fixing compatibility issues.
2. Enhanced Selenium Grid
Selenium Grid 4 was rebuilt from the ground up to solve the limitations of earlier versions. In the previous versions, it was hard to scale, required too much manual setup, and often became a bottleneck as test volumes grew.
The new version can now run as a simple standalone process or be configured as a fully distributed system. It also works well with Docker and Kubernetes, allowing teams to launch and manage test environments as containers. This makes it more stable and easier to scale for larger test environments.
Also Read: How to run Selenium Tests in Docker
Here are the three ways you can run the Grid in Selenium 4:
- Standalone Mode: All components run in a single process. This is ideal when you have a smaller test suite and don’t want to configure hubs and nodes separately.
- Hub and Node Mode: Similar to earlier versions, but now with better support for IPv6 and secure connections over HTTPS. This suits teams that maintain their own test infrastructure.
- Fully Distributed Mode: The Grid can be split into separate services, such as the event bus, node registry, and session handlers. This is valuable for teams that run hundreds of test instances simultaneously across servers or clusters.
3. Upgraded Selenium 4 IDE
Most QA engineers using the Selenium tool suite are familiar with the popular record and playback tool – Selenium IDE. This Selenium IDE was earlier available just as a Firefox add-on. Later, it got deprecated with the introduction of the latest Firefox versions. This is because the add-ons in the latest Firefox (ver. 55) were standardized under the Web Extension mechanism.
With Selenium 4, the IDE is revived and now its add-on is available for major web-browsers like Firefox and Chrome. The add-on for Selenium IDE is now also available on the MS store.
The new Selenium 4 IDE provides some notable features like:
- Improved GUI for intuitive user experience.
- The new IDE also comes bundled with a SIDE tool aka Selenium IDE runner. It allows QAs to run .side projects on a node.js platform. This SIDE runner also enables individual QAs to run cross browser tests on local or Cloud Selenium Grid.
- Improved control flow mechanism that enables testers to write better “while” and “if” conditions.
- The new IDE comes with an enhanced element locator strategy (Like a backup strategy) which helps locate an element in case the web element couldn’t be located. It will result in the creation of stable test cases.
- The code for test cases recorded using Selenium IDE can be exported in the desired language binding like Java, C#, Python, .NET, and JavaScript.
4. Relative Locators in Selenium 4
Finding elements by absolute paths or long CSS selectors often breaks when page layouts change. Selenium 4 introduced relative locators to fix this problem. These locators find elements based on their position relative to other components. This makes test scripts more readable and resilient when the page layout is updated.
For example, you can locate an element that appears above or to the left of another element. This way, you don’t have to rely on fragile, long selectors whenever the layout changes.
5. Improved Documentation
The old documentation in earlier versions of Selenium was scattered and poorly organized. For people new to Selenium, it was challenging to understand, and for experienced testers, finding the detailed information they needed was time-consuming.
In Selenium 4, the documentation section is more organized, code examples have been updated and verified, and key topics are explained in enough depth. This makes it much faster for teams to set up projects and adopt new features.
Here’s what has changed in the new documentation:
- Better Structure: Guides are grouped clearly by topics, making it easy to locate the correct information.
- Updated Examples: Scripts match the latest APIs and coding patterns introduced in version 4.
- Improved Use Cases: Covers common scenarios like working with relative locators and using the Chrome Debugging Protocol.
- Clear Explanations: Shows how to solve actual test automation problems instead of just listing method signatures.
Read More: Understanding Testing Documentation
6. Support for Chrome Debugging Protocol
Modern web applications are highly dynamic, which makes capturing network activity, console messages, or page performance data challenging using only traditional WebDriver commands. In version 4, this gap is closed by adding direct support for the Chrome Debugging Protocol (CDP). This allows test scripts to access browser‑level information that was only available to developers or special tools before.
Here’s what this feature brings to the table:
- Network Interception: Enables access to requests and responses so you can analyze and validate data exchanged between the browser and server.
- Console Monitoring: Captures error messages and logs from the browser console, making it easier to debug test failures.
- Performance Insights: Provides access to page load metrics and rendering statistics for performance testing.
- Additional Control: Enables triggering or responding to browser events previously unavailable in WebDriver.
7. Better Window/Tab Management in Selenium 4
There are several instances in test automation wherein one might need to open a particular link in a new tab or window to perform certain actions. To achieve this in Selenium 3, QAs had to create a new driver object and then perform the switch operation using the WindowHandle method to perform subsequent steps.
This is set to change in Selenium 4 as it comes with a new API – newWindow that allows users to create and switch to a new window/tab without creating a new WebDriver object.
Sample code snippet to open a new window
driver.get("https://www.google.com/"); // Opens a new window and switches to new window driver.switchTo().newWindow(WindowType.WINDOW); // Opens BrowserStack homepage in the newly opened window driver.navigate().to("https://www.browserstack.com/");
Sample code snippet to open a new tab within the same window
driver.get("https://www.google.com/"); // Opens a new tab in existing window driver.switchTo().newWindow(WindowType.TAB); // Opens Browserstack homepage in the newly opened tab driver.navigate().to("https://www.browserstack.com/");
8. Updated the Actions Class
The Actions class has been upgraded in Selenium 4, making it more flexible and aligned with the needs of modern test automation. In earlier versions, it was limited when dealing with multi‑element interactions, especially on dynamic pages.
The latest version of Selenium addresses these limitations by making the Action methods more robust and predictable.
Here are the key changes introduced in Selenium 4.0:
- Better Mouse Support: New methods like clickAndHold() and release() make it simple to work with drag‑and‑drop elements.
- Keyboard Improvements: Methods like keyDown() and keyUp() work reliably across modern browsers and allow combinations with other interactions.
Also Read: Mastering Keyboard Actions in Selenium
- More Consistency: The updated syntax works the same across browsers and platforms, reducing unexpected behavior when running the same test in different environments.
9. New and Improved Fluent Wait
The new feature in Selenium 4 includes a refined Fluent Wait that gives testers more precision when dealing with asynchronous page behavior. In earlier versions, the wait mechanisms worked, but often felt too rigid, making test scripts fragile when dealing with elements that appear or disappear slowly.
In the latest version of Selenium, Fluent Wait has been enhanced for better control and readability. Here’s how it improves test synchronization:
- Better Timing Control: Enables precise polling intervals and wait times for pages that load or update asynchronously.
- Custom Exception Handling: Ignores specific exceptions during waits so scripts don’t fail due to temporary delays or missing elements.
- Improved Readability: Provides cleaner syntax for wait conditions so test code is simpler to understand and maintain.
10. Advanced Screenshot Capabilities (Elements and Full Page)
Earlier versions of Selenium could only capture the visible area of a page. This was a problem when you needed to test long pages or verify only specific elements. In Selenium 4, this limitation is removed. You can now capture screenshots of individual elements or the entire page in one call. This makes it much easier to test layouts and confirm behavior.
Here’s how these new screenshot options work:
- Element Screenshot: Captures only the target element so that you can verify a specific component.
- Full Page Screenshot: Captures the whole page including sections not immediately visible in the viewport making it ideal for long or scrollable pages.
11. Monitoring and Tracing Features
Earlier versions of Selenium gave minimal access to browser events and performance data. The new version adds built‑in Chrome DevTools Protocol (CDP) support to track network requests, measure page load times, and review console messages. This gives you a clear view of how pages behave and why specific test steps fail.
Here’s how these new monitoring and tracing options work:
- Network Monitoring: Shows all requests and responses between the page and the server. This makes it much easier to spot delays or failed requests.
- Performance Tracing: Captures page load metrics and timings so you can pinpoint where delays occur and adjust your test strategy.
Also Read: How to check Website Loading Time
- Log Capturing: Collects console messages and errors to help you trace issues precisely without relying on external tools.
12. Deprecation of Desired Capabilities and FindBy
Previous versions of Selenium used DesiredCapabilities and FindBy for browser configuration and element location. These caused inconsistencies across browsers and added complexity when updating test code. In Selenium 4, both have been replaced with cleaner, standardized alternatives.
Here’s how these changes work:
- Options Objects: Options objects have replaced DesiredCapabilities in Selenium WebDriver for setting browser settings. This change makes the test setup align with the official WebDriver standard.
- By Locators Only: Removes FindsBy and uses the official By syntax so test code is clearer and works the same across environments.
13. Bidirectional APIs
One of the biggest changes introduced in Selenium 4 is its support for Bidirectional APIs (BiDi). In earlier versions, communication between the test script and the browser was primarily one-way. The test would send commands, and the browser would respond. With BiDi APIs, this interaction goes both ways, allowing the browser to send information back to the test script in real time.
Bidirectional APIs enable highly interactive and insightful test automation, making it ideal for advanced use cases like performance profiling, network traffic analysis, and security testing.
With Bidirectional APIs, test scripts can now:
- Listen to browser events like console messages, network requests, and errors.
- Perform advanced debugging by capturing performance metrics and JavaScript console output.
- Control and manipulate the browser in real time, including intercepting requests, simulating network conditions, or emulating device settings.
How Does BrowserStack Enhance Selenium Testing?
You need to run your Selenium tests on real devices and browsers. Emulators often miss mobile‑specific behavior, such as touch gestures, rendering differences across OS versions, or delays caused by mobile networks. Testing in real environments helps you spot and fix these issues before they affect your users.
You need a range of real devices and browsers to test reliably, but setting up and maintaining them is challenging. BrowserStack solves this by giving you access to over 3,500 real mobile devices and desktop browsers in the cloud. This means you can run your Selenium tests on real user conditions, find issues early, and release more confidently.
Here are the key features of BrowserStack that make it ideal for Selenium testing:
- Cloud Selenium Grid: Run your Selenium scripts on actual mobile browsers to validate responsiveness, layout behavior, and mobile‑specific rendering.
- Parallel Testing: Execute multiple test scripts simultaneously to reduce execution time and speed up your test cycles.
- Local Environment Testing: Run your Selenium scripts securely against internal servers or staging environments.
- Web Performance Testing: Measure page load times and rendering behavior across browsers and devices to spot performance issues early.
Conclusion
Selenium 4 brings various changes that make test automation more stable and readable. Its enhanced Grid, updated WebDriver APIs, new relative locators, and built‑in Chrome DevTools support remove long‑standing limitations and give testers more precision when building and maintaining scripts.
However, it is still crucial to run Selenium tests on different browsers and devices. BrowserStack makes it easier by allowing you to test on 3,500+ real browsers and devices. It enables you to test websites hosted on local environments, supports parallel test execution, integrates with popular frameworks, and provides detailed logs and video recordings for faster debugging.