我想在我的本地機器上使用下面的代碼啓動IE11瀏覽器。Selenium:意外的錯誤啓動IE。瀏覽器縮放級別設置爲122%。它應該設置爲100%
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%。即使這樣,錯誤也會出現。