Page being translated from
English to Portuguese. Do you speak Portuguese? 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.
1 - Browsing Context
Page being translated from
English to Portuguese. Do you speak Portuguese? Help us to translate
it by sending us pull requests!
Commands
This section contains the APIs related to browsing context commands.
it('test create a browsing context for given id',asyncfunction(){const id =await driver.getWindowHandle()const browsingContext =awaitBrowsingContext(driver,{
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.
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.
it('test get tree with depth',asyncfunction(){const browsingContextId =await driver.getWindowHandle()const parentWindow =awaitBrowsingContext(driver,{browsingContextId: browsingContextId,})await parentWindow.navigate('https://www.selenium.dev/selenium/web/iframes.html','complete')
Provides a tree of all browsing contexts descending from the parent browsing context, including the parent browsing context upto the depth value passed.
it('test get tree with depth',asyncfunction(){const browsingContextId =await driver.getWindowHandle()const parentWindow =awaitBrowsingContext(driver,{browsingContextId: browsingContextId,})await parentWindow.navigate('https://www.selenium.dev/selenium/web/iframes.html','complete')
it.skip('Get All Top level browsing contexts',async()=>{const id =await driver.getWindowHandle()const window1 =awaitBrowsingContext(driver,{browsingContextId: id,})
it('test close a window',asyncfunction(){const window1 =awaitBrowsingContext(driver,{type:'window'})const window2 =awaitBrowsingContext(driver,{type:'window'})
it('can take box screenshot',asyncfunction(){const id =await driver.getWindowHandle()const browsingContext =awaitBrowsingContext(driver,{browsingContextId: id,})
await driver.get("https://www.selenium.dev/selenium/web/printPage.html")const result =await browsingContext.printPage({orientation:'landscape',scale:1,background:true,width:30,height:30,top:1,bottom:1,left:1,right:1,shrinkToFit:true,
try(Network network =newNetwork(driver)){
network.addIntercept(newAddInterceptParameters(InterceptPhase.AUTH_REQUIRED));
network.onAuthRequired(
responseDetails ->// Does not handle the alert
network.continueWithAuthNoCredentials(responseDetails.getRequest().getRequestId()));
driver.get("https://the-internet.herokuapp.com/basic_auth");
try(Network network =newNetwork(driver)){
network.addIntercept(newAddInterceptParameters(InterceptPhase.AUTH_REQUIRED));
network.onAuthRequired(
responseDetails ->// Does not handle the alert
network.cancelAuth(responseDetails.getRequest().getRequestId()));
driver.get("https://the-internet.herokuapp.com/basic_auth");