【发布时间】:2017-09-17 16:27:44
【问题描述】:
如果有人可以帮助编写下面的代码,我将不胜感激
打包 IEProjects;
导入 org.openqa.selenium.WebDriver; 导入 org.openqa.selenium.ie.InternetExplorerDriver;
public class startIE {
public static void main(String[] args) {
System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer_Win32_3.3.0\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
driver.get("http://www.google.com");
}
}
我得到以下结果
Started InternetExplorerDriver server (32-bit)
3.3.0.0
Listening on port 29209
Only local connections are allowed
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Browser zoom level was set to 150%. It should be set to 100% (WARNING: The server did not provide any stacktrace information)
它启动 IE 并没有执行该操作。下面是IE页面上打印的内容
This is the initial start page for the WebDriver server. http://localhost:41380/
【问题讨论】: