首页 > 代码库 > selenium使用IE 浏览器问题
selenium使用IE 浏览器问题
Started InternetExplorerDriver server (64-bit) 2.25.2.0 Listening on port 40961Exception in thread "main" org.openqa.selenium.WebDriverException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 1.18 seconds Build info: version: ‘2.25.0‘, revision: ‘17482‘, time: ‘2012-07-18 22:18:01‘System info: os.name: ‘Windows 7‘, os.arch: ‘x86‘, os.version: ‘6.1‘, java.version: ‘1.6.0_29‘Driver info: driver.version: InternetExplorerDriver Session ID: 01e30b64-e403-440c-bed8-4859ef2128f9 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:188) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:498) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:182) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:167) at org.openqa.selenium.ie.InternetExplorerDriver.startSession(InternetExplorerDriver.java:133) at org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:106) at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:52) at com.selenium.test.TempGoogle.main(TempGoogle.java:15)
如果遇到上面的问题
解决方法有两种: 1.是修改掉IE的设置,不要在任何情况下使用保护模式(protected mode) 2.另一种即是前面代码中如下片段在运行时设置IE的Capabilities。 DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer(); ieCapabilities.setCapability (InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true); WebDriver oWebDriver = new InternetExplorerDriver(ieCapabilities);
高端自动化测试交流群:310924886
selenium使用IE 浏览器问题
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。