Support for WebDriver BiDi Protocol in Browsers
Digital.ai Testing now supports the WebDriver BiDi (Bidirectional) protocol for browsers, enabling real-time, two-way communication between automation frameworks and web browsers.
info
Safari does NOT support the Bidirectional WebDriver (BD) protocol. This is a Safari browser limitation, not a limitation of the Digital.ai Testing platform.
Example – Bidirectional WebDriver in Digital.ai Testing
Map<String, Object> options = new HashMap<>();
options.put("accessKey", ACCESS_KEY);
options.put("testName", "BiDi Test");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setCapability("digitalai:options", options);
chromeOptions.setCapability("webSocketUrl", true);
WebDriver driver = new RemoteWebDriver(CLOUD_URL, options)
driver = new Augmenter().augment(driver);
try (LogInspector logInspector = new LogInspector(driver)) {
// Add a listener for console log entries
logInspector.onConsoleEntry(entry -> {
if (entry != null) {
System.out.println("Console Log: " + entry.getText());
}
});
}
// Navigate to a page that generates console logs
driver.get("https://www.selenium.dev/selenium/web/bidi/logEntryAdded.html");
driver.findElement(By.id("consoleLog")).click();