Skip to content

[🚀 Feature]: Add HasBiDi to Chromium Driver class #12015

@titusfortner

Description

@titusfortner

Feature and motivation

Chromium has implemented a number of BiDi features, but it is not currently implementing the interface, so they can not be used: https://wpt.fyi/results/webdriver/tests/bidi?label=experimental&label=master&aligned

As part of this, we should also add a method to the Options class to set webSocketUrl to true as part of enabling BiDi. https://w3c.github.io/webdriver-bidi/#establishing

Usage example

ChromeOptions options = new ChromeOptions();
options.setCapability("webSocketUrl", true);
driver = new ChromeDriver();

try (LogInspector logInspector = new LogInspector(driver)) {
    CompletableFuture<ConsoleLogEntry> future = new CompletableFuture<>();
    logInspector.onConsoleLog(future::complete);

    driver.get("https://www.selenium.dev/selenium/web/bidi/logEntryAdded.html");
    driver.findElement(By.id("consoleLog")).click();

    ConsoleLogEntry logEntry = future.get(5, TimeUnit.SECONDS);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaJava BindingsI-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions