I'm currently attempting to execute the following code in Microsoft Edge using WebDriver
ExpectedCondition<Boolean> jsLoad = driver -> ((JavascriptExecutor) driver).executeScript("return
document.readyState").toString().equals("complete");
JavascriptExecutor js = (JavascriptExecutor) getDriver();
boolean jsReady = (Boolean) js.executeScript("return document.readyState").toString().equals("complete");
An exception is being thrown:
Exception class:org.openqa.selenium.JavascriptException
The issue stems from:
org.openqa.selenium.JavascriptException: javascript error: Function is not a constructor
We've configured EdgeOptions as follows
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setBrowserName("MicrosoftEdge");
EdgeOptions edgeOptions = new EdgeOptions();
edgeOptions.setCapability("ms:inPrivate", true);
edgeOptions.setCapability("prefs", edgePrefs);
edgeOptions.setCapability("useAutomationExtension", false);
edgeOptions.merge(desiredCapabilities);
edgeOptions.setPageLoadStrategy("eager");
edgeOptions.setCapability("ms:inPrivate", true);
edgeOptions.setCapability("useAutomationExtension", false);
edgeOptions.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, true);
edgeOptions.setCapability(CapabilityType.HAS_NATIVE_EVENTS, true);
driver = new EdgeDriver(edgeOptions);
Any recommendations or suggestions?