From 5d9bea7422a646ef0ef9040cdabf7a75edad1747 Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Mon, 25 Nov 2024 19:24:23 +0100 Subject: [PATCH] try to enable bidi --- src/test/java/org/htmlunit/WebDriverTestCase.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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);