Bidi

37 views
Skip to first unread message

Airat

unread,
May 13, 2024, 12:24:07 AMMay 13
to Selenium Users
Hello, can I get some advice? I tried to use BrowsingContext, and getting exception.
Which reasons can be?

Latest version available in Maven Central
all necessary classes exist
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.20.0</version>
</dependency>


public class Main {
public static void main(String[] args) {
SeleniumLogger.enable();
WebDriver driver = new ChromeDriver();
driver.get("https://google.com");
testCreateAWindow(driver);
}

static void testCreateAWindow(WebDriver driver) {
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
System.out.println("TEST " + browsingContext.getId());
driver.quit();
}
}

And I'm getting
Exception in thread "main" org.openqa.selenium.bidi.BiDiException: Unable to create a BiDi connection
Build info: version: '4.20.0', revision: '866c76ca80'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-28-generic', java.version: '17.0.10'
Driver info: BiDi Connection
at org.openqa.selenium.bidi.HasBiDi.lambda$getBiDi$0(HasBiDi.java:25)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at org.openqa.selenium.bidi.HasBiDi.getBiDi(HasBiDi.java:25)
at org.openqa.selenium.bidi.browsingcontext.BrowsingContext.<init>(BrowsingContext.java:92)
at org.example.Main.testCreateAWindow(Main.java:17)
at org.example.Main.main(Main.java:13)


Krishnan Mahadevan

unread,
May 13, 2024, 12:38:21 AMMay 13
to seleniu...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/877c6474-3536-4f60-b7dc-e7d5b4883acfn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages