我正在使用 Internet Explorer 驱动程序 4.0.0(32 位)和 selenium 更新版本 4.1.2 当我使用 Internet Explorer 驱动程序 4.0.0 运行代码时,它停留在 这是
WebDriver
服务器的初始启动页面。
即使我检查了 Internet Explorer 中的设置:
但是当我将 Internet Explorer 驱动程序更改为 3.1.4 时,它工作正常。我也尝试过 64 位的 Internet Explorer 4.0.0,但我面临同样的问题,请帮助我。
public class EdgeTest {
static RemoteWebDriver driver = null;
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.ie.driver",
"D:\\Automation\\Jar Details\\Drivers\\IEDriverServer_Win32_4.0.0\\IEDriverServer.exe");
InternetExplorerOptions ieOptions = new InternetExplorerOptions();
ieOptions.attachToEdgeChrome();
ieOptions.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");
ieOptions.setCapability("ignoreProtectedModeSettings", true);
ieOptions.setCapability("ignoreZoomSettings",true);
System.out.println("this:"+ieOptions.getCapability("ignoreZoomSettings"));
driver = new InternetExplorerDriver(ieOptions);
InternetExplorerDriverService.createDefaultService();
driver.get("https://github.com/");
WebElement elem = driver.findElement(By.name("q"));
elem.sendKeys("gitu");
elem.sendKeys(Keys.ENTER);
driver.quit();
error: "Could not create a new remote session" 这是一个错误 得到