WebDriver BiDi (双方向機能) WebDriver BiDi は、Selenium プロジェクトとブラウザベンダーが共同で策定した、ブラウザ自動化のための W3C 標準の双方向プロトコルです。WebDriver に WebSocket 接続を追加することで、ネットワークリクエスト、 コンソールメッセージ、JavaScript エラーといったブラウザイベントをリアルタイムに受け取って処理できます。 Chrome DevTools Protocol を置き換える、クロスブラウザな標準です。
BiDirectional means that communication is happening in two directions simultaneously.
The traditional WebDriver model involves strict request/response commands which only allows for communication to
happen in one direction at any given time. In most cases this is what you want; it ensures that the browser is
doing the expected things in the right order, but there are a number of interesting things that can be done with
asynchronous interactions.
This functionality is currently available in a limited fashion with the [Chrome DevTools Protocol] (CDP),
but to address some of its drawbacks, the Selenium team, along with the major
browser vendors, have worked to create the new WebDriver BiDi Protocol .
This specification aims to create a stable, cross-browser API that leverages bidirectional
communication for enhanced browser automation and testing functionality,
including streaming events from the user agent to the controlling software via WebSockets.
Users will be able to listen for and record or manipulate events as they happen during the course of a Selenium session.
Enabling BiDi in Selenium In order to use WebDriver BiDi, setting the capability in the browser options will enable the required functionality:
Java
Python
CSharp
Ruby
JavaScript
Kotlin options . setCapability ( "webSocketUrl" , true ); options . enable_bidi = True options . web_socket_url = true options . setCapability ( "webSocketUrl" , true ); This enables the WebSocket connection for bidirectional communication,
unlocking the full potential of the WebDriver BiDi protocol.
Note that Selenium is updating its entire implementation from WebDriver Classic to WebDriver BiDi (while
maintaining backwards compatibility as much as possible), but this section of documentation focuses on the new
functionality that bidirectional communication allows.
The low-level BiDi domains will be accessible in the code to the end user, but the goal is to provide
high-level APIs that are straightforward methods of real-world use cases. As such, the low-level
components will not be documented, and this section will focus only on the user-friendly
features that we encourage users to take advantage of.
If there is additional functionality you’d like to see, please raise a
feature request .
1 - WebDriver BiDi Logging Features These features are related to logging. Because “logging” can refer to so many different things, these methods are made available via a “script” namespace.
Remember that to use WebDriver BiDi, you must enable it in Options.
For more details, see Enabling BiDi
Console Message Handlers Record or take actions on console.log events.
Add Handler
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/high_level/LogTest.java
Copy
Close
/examples/python/tests/bidi/test_bidi_logging.py
Copy
Close
/examples/ruby/spec/bidi/logging_spec.rb
Copy
Close
Remove Handler You need to store the ID returned when adding the handler to delete it.
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/high_level/LogTest.java
Copy
Close
/examples/python/tests/bidi/test_bidi_logging.py
Copy
Close
/examples/ruby/spec/bidi/logging_spec.rb
Copy
Close
JavaScript Exception Handlers Record or take actions on JavaScript exception events.
Add Handler
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/high_level/LogTest.java
Copy
Close
/examples/python/tests/bidi/test_bidi_logging.py
Copy
Close
/examples/ruby/spec/bidi/logging_spec.rb
Copy
Close
Remove Handler You need to store the ID returned when adding the handler to delete it.
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/high_level/LogTest.java
Copy
Close
/examples/python/tests/bidi/test_bidi_logging.py
Copy
Close
/examples/ruby/spec/bidi/logging_spec.rb
Copy
Close
2 - WebDriver BiDi Network Features These features are related to networking, and are made available via a “network” namespace.
The implementation of these features is being tracked here: #13993
Remember that to use WebDriver BiDi, you must enable it in Options.
For more details, see Enabling BiDi
Authentication Handlers Authentication handlers enable you to intercept authentication requests that occur during a network interaction.
These handlers are useful for automating scenarios involving authentication prompts, such as Basic Auth or Digest Auth.
They allow you to programmatically provide credentials or modify the authentication flow.
Add Handler
Java
Python
CSharp
Ruby
JavaScript
Kotlin
/examples/ruby/spec/bidi/network_spec.rb
Copy
Close
Request Handlers Request handlers allow you to intercept and manipulate outgoing network requests before they are sent to the server.
This can be used to modify request headers, change the request body, or block specific requests.
Request handlers are essential for testing and debugging scenarios where you need control over outgoing traffic.
Add Handler
Java
Python
CSharp
Ruby
JavaScript
Kotlin Response Handlers Response handlers enable you to intercept and manipulate incoming responses from the server.
They are particularly useful for testing scenarios involving response data, such as verifying or modifying response headers, status codes, or content before it reaches the browser.
Java
Python
CSharp
Ruby
JavaScript
Kotlin Remove Handler
Java
Python
CSharp
Ruby
JavaScript
Kotlin Clear Handlers
Java
Python
CSharp
Ruby
JavaScript
Kotlin 3 - WebDriver BiDi Script Features These features are related to scripts, and are made available via a “script” namespace.
The implementation of these features is being tracked here: #13992
Remember that to use WebDriver BiDi, you must enable it in Options.
For more details, see Enabling BiDi
Script Pinning Execute Script DOM Mutation Handlers 4 - Chrome DevTools Protocol Examples of working with Chrome DevTools Protocol in Selenium. CDP support is temporary until WebDriver BiDi has been implemented.
Page being translated from English to Japanese.
Do you speak Japanese? Help us to translate
it by sending us pull requests!
Many browsers provide “DevTools” – a set of tools that are integrated with the browser that
developers can use to debug web apps and explore the performance of their pages. Google Chrome’s
DevTools make use of a protocol called the Chrome DevTools Protocol (or “CDP” for short).
As the name suggests, this is not designed for testing, nor to have a stable API, so functionality
is highly dependent on the version of the browser.
Selenium is working to implement a standards-based, cross-browser, stable alternative to CDP called
[WebDriver BiDi]. Until the support for this new protocol has finished, Selenium plans to provide access
to CDP features where applicable.
Chrome and Edge have a method to send basic CDP commands.
This does not work for features that require bidirectional communication, and you need to know what domains to enable when
and the exact names and types of domains/methods/parameters.
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/CdpTest.java
Copy
Close
/examples/python/tests/bidi/cdp/test_cdp.py
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/CDPTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/cdp_spec.rb
Copy
Close
To make working with CDP easier, and to provide access to the more advanced features, Selenium bindings
automatically generate classes and methods for the most common domains.
CDP methods and implementations can change from version to version, though, so you want to keep the
version of Chrome and the version of DevTools matching. Selenium supports the 3 most
recent versions of Chrome at any given time,
and tries to time releases to ensure that access to the latest versions are available.
This limitation provides additional challenges for several bindings, where dynamically
generated CDP support requires users to regularly update their code to reference the proper version of CDP.
In some cases an idealized implementation has been created that should work for any version of CDP without the
user needing to change their code, but that is not always available.
Examples of how to use CDP in your Selenium tests can be found on the following pages, but
we want to call out a couple commonly cited examples that are of limited practical value.
Geo Location — almost all sites use the IP address to determine physical location,
so setting an emulated geolocation rarely has the desired effect.Overriding Device Metrics — Chrome provides a great API for setting Mobile Emulation
in the Options classes, which is generally superior to attempting to do this with CDP.4.1 - Chrome DevTools Logging Features Logging features using CDP.
Page being translated from English to Japanese.
Do you speak Japanese? Help us to translate
it by sending us pull requests!
While Selenium 4 provides direct access to the Chrome DevTools Protocol, these
methods will eventually be removed when WebDriver BiDi implemented.
Console Logs
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/LoggingTest.java
Copy
Close
/examples/python/tests/bidi/cdp/test_logs.py
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/LoggingTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/logging_spec.rb
Copy
Close
JavaScript Exceptions
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/python/tests/bidi/cdp/test_logs.py
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/LoggingTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/logging_spec.rb
Copy
Close
4.2 - Chrome DevTools Network Features Network features using CDP.
Page being translated from English to Japanese.
Do you speak Japanese? Help us to translate
it by sending us pull requests!
While Selenium 4 provides direct access to the Chrome DevTools Protocol, these
methods will eventually be removed when WebDriver BiDi implemented.
Basic authentication Some applications make use of browser authentication to secure pages.
It used to be common to handle them in the URL, but browsers stopped supporting this.
With this code you can insert the credentials into the header when necessary
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java
Copy
Close
/examples/python/tests/bidi/cdp/test_network.py
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/network_spec.rb
Copy
Close
Network Interception Both requests and responses can be recorded or transformed.
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/network_spec.rb
Copy
Close
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/network_spec.rb
Copy
Close
Request interception
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/network_spec.rb
Copy
Close
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java
Copy
Close
/examples/python/tests/bidi/cdp/test_network.py
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/network_spec.rb
Copy
Close
Setting Cookies
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java
Copy
Close
/examples/python/tests/bidi/cdp/test_network.py
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/network_spec.rb
Copy
Close
Waiting for Downloads
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/network_spec.rb
Copy
Close
4.3 - Chrome DevTools Script Features Script features using CDP.
Page being translated from English to Japanese.
Do you speak Japanese? Help us to translate
it by sending us pull requests!
While Selenium 4 provides direct access to the Chrome DevTools Protocol, these
methods will eventually be removed when WebDriver BiDi implemented.
Script Pinning
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/ScriptTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/ScriptTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/script_spec.rb
Copy
Close
DOM Mutation Handlers
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java
Copy
Close
/examples/python/tests/bidi/cdp/test_script.py
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/CDP/ScriptTest.cs
Copy
Close
/examples/ruby/spec/bidi/cdp/script_spec.rb
Copy
Close
5 - BiDirectional API (W3C compliant)
Page being translated from English to Japanese.
Do you speak Japanese? Help us to translate
it by sending us pull requests!
The following list of APIs will be growing as the WebDriver BiDirectional Protocol grows
and browser vendors implement the same.
Additionally, Selenium will try to support real-world use cases that internally use a combination of W3C BiDi protocol APIs.
If there is additional functionality you’d like to see, please raise a
feature request .
5.1 - Browsing Context
Page being translated from
English to Japanese. Do you speak Japanese? Help us to translate
it by sending us pull requests!
Commands This section contains the APIs related to browsing context commands.
Open a new window Creates a new browsing context in a new window.
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Create.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Open a new tab Creates a new browsing context in a new tab.
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Create.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Use existing window handle Creates a browsing context for the existing tab/window to run commands.
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Create.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Open a window with a reference browsing context A reference browsing context is a top-level browsing context .
The API allows to pass the reference browsing context, which is used to create a new window. The implementation is operating system specific.
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Create.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Open a tab with a reference browsing context A reference browsing context is a top-level browsing context .
The API allows to pass the reference browsing context, which is used to create a new tab. The implementation is operating system specific.
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Create.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Navigate to a URL
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Navigate.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Navigate to a URL with readiness state
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Navigate.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Get browsing context tree Provides a tree of all browsing contexts descending from the parent browsing context, including the parent browsing context.
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.GetTree.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Get browsing context tree with depth Provides a tree of all browsing contexts descending from the parent browsing context, including the parent browsing context upto the depth value passed.
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.GetTree.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Get All Top level browsing contexts
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.GetTree.cs
Copy
Close
Selenium v4.20.0
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Close a tab/window
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Close.cs
Copy
Close
Selenium v4.8
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Activate a browsing context
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.14.1
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Activate.cs
Copy
Close
Selenium v4.15
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Reload a browsing context
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.13.0
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Reload.cs
Copy
Close
Selenium v4.15
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Handle user prompt
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.13.0
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.HandleUserPrompt.cs
Copy
Close
Selenium v4.15
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Capture Screenshot
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.13.0
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs
Copy
Close
Selenium v4.15
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Capture Viewport Screenshot
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.14.0
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs
Copy
Close
Selenium v4.15
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Capture Element Screenshot
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.14.0
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs
Copy
Close
Selenium v4.15
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Set Viewport
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.14.1
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.SetViewport.cs
Copy
Close
Selenium v4.15
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Print page
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.14.1
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Print.cs
Copy
Close
Selenium v4.10
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Navigate back
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.16.0
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Navigate.cs
Copy
Close
Selenium v4.17
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Navigate forward
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.16.0
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Navigate.cs
Copy
Close
Selenium v4.17
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Traverse history
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.16.0
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Navigate.cs
Copy
Close
Selenium v4.17
/examples/javascript/test/bidirectional/browsingContext.spec.js
Copy
Close
Events This section contains the APIs related to browsing context events.
Browsing Context Created Event
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.10
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextInspectorTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.BrowsingContextCreated.cs
Copy
Close
Selenium v4.9.2
/examples/javascript/test/bidirectional/browsingContextInspector.spec.js
Copy
Close
Dom Content loaded Event
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.10
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextInspectorTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.DomContentLoaded.cs
Copy
Close
Selenium v4.9.2
/examples/javascript/test/bidirectional/browsingContextInspector.spec.js
Copy
Close
Browsing Context Loaded Event
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.10
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextInspectorTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.BrowsingContextLoaded.cs
Copy
Close
Selenium v4.9.2
/examples/javascript/test/bidirectional/browsingContextInspector.spec.js
Copy
Close
Navigated Started Event
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextInspectorTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.NavigationStarted.cs
Copy
Close
Fragment Navigated Event
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextInspectorTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.FragmentNavigated.cs
Copy
Close
Selenium v4.15.0
/examples/javascript/test/bidirectional/browsingContextInspector.spec.js
Copy
Close
User Prompt Opened Event
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextInspectorTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.UserPrompt.cs
Copy
Close
User Prompt Closed Event
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextInspectorTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.UserPrompt.cs
Copy
Close
Browsing Context Destroyed Event
Java
CSharp
Ruby
JavaScript
Kotlin Selenium v4.18
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextInspectorTest.java
Copy
Close
/examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.BrowsingContextDestroyed.cs
Copy
Close
Selenium v4.18.0
/examples/javascript/test/bidirectional/browsingContextInspector.spec.js
Copy
Close
5.2 - Browsing Context
Page being translated from
English to Japanese. Do you speak Japanese? Help us to translate
it by sending us pull requests!
This section contains the APIs related to input commands.
Java
Ruby
JavaScript
Kotlin Selenium v4.17
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ActionsTest.java
Copy
Close
Selenium v4.17
/examples/javascript/test/bidirectional/input.spec.js
Copy
Close
Release Actions
Java
Ruby
JavaScript
Kotlin Selenium v4.17
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ActionsTest.java
Copy
Close
Selenium v4.17
/examples/javascript/test/bidirectional/input.spec.js
Copy
Close
5.3 - Network
Page being translated from
English to Japanese. Do you speak Japanese? Help us to translate
it by sending us pull requests!
Commands This section contains the APIs related to network commands.
Add network intercept
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.18
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkCommandsTest.java
Copy
Close
Selenium v4.32
/examples/python/tests/bidi/test_network_commands.py
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/network_commands.spec.js
Copy
Close
Remove network intercept
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.18
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkCommandsTest.java
Copy
Close
Selenium v4.32
/examples/python/tests/bidi/test_network_commands.py
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/network_commands.spec.js
Copy
Close
Continue request blocked at authRequired phase with credentials
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.18
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkCommandsTest.java
Copy
Close
Selenium v4.46
/examples/python/tests/bidi/test_network_commands.py
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/network_commands.spec.js
Copy
Close
Continue request blocked at authRequired phase without credentials
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.18
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkCommandsTest.java
Copy
Close
Selenium v4.46
/examples/python/tests/bidi/test_network_commands.py
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/network_commands.spec.js
Copy
Close
Cancel request blocked at authRequired phase
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.18
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkCommandsTest.java
Copy
Close
Selenium v4.46
/examples/python/tests/bidi/test_network_commands.py
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/network_commands.spec.js
Copy
Close
Fail request
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.18
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkCommandsTest.java
Copy
Close
Selenium v4.46
/examples/python/tests/bidi/test_network_commands.py
Copy
Close
Events This section contains the APIs related to network events.
Before Request Sent
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkEventsTest.java
Copy
Close
Selenium v4.32
/examples/python/tests/bidi/test_network_commands.py
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/network_events.spec.js
Copy
Close
Response Started
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkEventsTest.java
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/network_events.spec.js
Copy
Close
Response Completed
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkEventsTest.java
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/network_events.spec.js
Copy
Close
Auth Required
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.17
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkEventsTest.java
Copy
Close
Selenium v4.46
/examples/python/tests/bidi/test_network_commands.py
Copy
Close
5.4 - Script
Page being translated from
English to Japanese. Do you speak Japanese? Help us to translate
it by sending us pull requests!
Commands This section contains the APIs related to script commands.
Call function in a browsing context
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Call function in a sandbox
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Call function in a realm
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Evaluate script in a browsing context
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Evaluate script in a sandbox
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Evaluate script in a realm
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Disown handles in a browsing context
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Disown handles in a realm
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Get all realms
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Get realm by type
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Get browsing context realms
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Get browsing context realms by type
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.9
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Preload a script
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.10
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Remove a preloaded script
Java
Ruby
JavaScript
Kotlin Selenium v4.15
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptTest.java
Copy
Close
Selenium v4.10
/examples/javascript/test/bidirectional/script_commands.spec.js
Copy
Close
Events This section contains the APIs related to script events.
Message
Java
Ruby
JavaScript
Kotlin Selenium v4.16
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptEventsTest.java
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/script_events.spec.js
Copy
Close
Realm Created
Java
Ruby
JavaScript
Kotlin Selenium v4.16
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptEventsTest.java
Copy
Close
Selenium v4.18
/examples/javascript/test/bidirectional/script_events.spec.js
Copy
Close
Realm Destroyed
Java
Ruby
JavaScript
Kotlin Selenium v4.16
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/ScriptEventsTest.java
Copy
Close
Selenium v4.19
/examples/javascript/test/bidirectional/script_events.spec.js
Copy
Close
5.5 - BiDirectional API (W3C compliant)
Page being translated from
English to Japanese. Do you speak Japanese? Help us to translate
it by sending us pull requests!
This section contains the APIs related to logging.
Console logs Listen to the console.log events and register callbacks to process the event.
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java
Copy
Close
Selenium v4.15
/examples/python/tests/bidi/test_bidi_logging.py
Copy
Close
/examples/javascript/test/bidirectional/logInspector.spec.js
Copy
Close
JavaScript exceptions Listen to the JS Exceptions
and register callbacks to process the exception details.
Java
Python
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java
Copy
Close
Selenium v4.15
/examples/python/tests/bidi/test_bidi_logging.py
Copy
Close
/examples/javascript/test/bidirectional/logInspector.spec.js
Copy
Close
Listen to JS Logs Listen to all JS logs at all levels and register callbacks to process the log.
Java
Python
Ruby
JavaScript
Kotlin Selenium v4.8
/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java
Copy
Close