diff --git a/src/test/java/org/htmlunit/WebDriverTestCase.java b/src/test/java/org/htmlunit/WebDriverTestCase.java
index 10657f41b7..e1c2e2f09a 100644
--- a/src/test/java/org/htmlunit/WebDriverTestCase.java
+++ b/src/test/java/org/htmlunit/WebDriverTestCase.java
@@ -505,6 +505,9 @@ protected WebDriver buildWebDriver() throws IOException {
final String locale = getBrowserVersion().getBrowserLocale().toLanguageTag();
final EdgeOptions options = new EdgeOptions();
+ // BiDi
+ options.setCapability("webSocketUrl", true);
+
options.addArguments("--lang=" + locale);
options.addArguments("--remote-allow-origins=*");
@@ -538,6 +541,9 @@ protected WebDriver buildWebDriver() throws IOException {
final String locale = getBrowserVersion().getBrowserLocale().toLanguageTag();
final ChromeOptions options = new ChromeOptions();
+ // BiDi
+ options.setCapability("webSocketUrl", true);
+
options.addArguments("--lang=" + locale);
options.addArguments("--remote-allow-origins=*");
options.addArguments("--disable-search-engine-choice-screen");
@@ -590,6 +596,9 @@ private FirefoxDriver createFirefoxDriver(final String geckodriverBinary, final
.build();
final FirefoxOptions options = new FirefoxOptions();
+ // BiDi
+ options.setCapability("webSocketUrl", true);
+
options.setBinary(binary);
String locale = getBrowserVersion().getBrowserLocale().toLanguageTag();
@@ -1168,7 +1177,6 @@ protected final WebDriver verifyTextArea2(final WebDriver driver,
}
protected final String getJsVariableValue(final WebDriver driver, final String varName) throws Exception {
-
final String script = "return String(" + varName + ")";
final String result = (String) ((JavascriptExecutor) driver).executeScript(script);