我正在尝试使用以下代码在本地计算机上启动 IE11 浏览器。
try{System.setProperty("webdriver.ie.driver", "src/main/resources/bin/IEDriverServer.exe");
}
catch (Exception ex){
Reporter.log("\nException in getting and setting the webdriver IE driver: "+ ex.getMessage() + ex.getClass(),true);
ex.printStackTrace();
}
WebDriverManager.browser = browser;
driver = new EventFiringWebDriver(new InternetExplorerDriver());
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
当我运行代码时,它会使用http://localhost:22414/打开浏览器,但之后无法加载。附上下面的日志。
org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Browser zoom level was set to 125%. It should be set to 100% (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.16 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'AAAAAA', ip: '123.123.123.123', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_79'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
我手动尝试将浏览器缩放级别设置为 100%。即使这样,错误也会出现。