org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launch IE

1.在启动ie浏览器前先加入属性设置一项:

DesiredCapabilities ie = DesiredCapabilities.internetExplorer();
ie.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);

System.setProperty("webdriver.ie.driver", "e:/IEDriverServer.exe");
driver = new InternetExplorerDriver(ie);

  

2.如果加入属性项返回“This is the initial start page for the WebDriver server.” 则说明你浏览器进行了缩放,具体如报错:

Exception in thread "main" 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)
解决方案:将IE浏览器缩放比例设置成100%  页面→缩放,选择100%,再次运行即可。

时间: 2024-12-28 20:13:43

org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launch IE的相关文章

maven webcollector java.lang.ClassNotFoundException: org.openqa.selenium.remote.SessionNotFoundException

使用webcollector时出现了如下异常 分析是依赖的问题,不仅要添加selenium-java,还要添加htmlunit-driver的依赖,注意不要添加成selenium-htmlunit-driver 1 <!-- selenium --> 2 <dependency> 3 <groupId>org.seleniumhq.selenium</groupId> 4 <artifactId>selenium-java</artifac

org.openqa.selenium.remote.SessionNotFoundException: The FirefoxDriver cannot be used after quit() was called.

该问题已经困扰了我很多天 问题终于解决了,全局变量导致的,碰到这种问题很难再自己本身的机器上发现错误,所以,应该看一下自己写的方法是否涉及到了全局变量出现不一致的情况,让其统一即可.

appium运行报错.&lt;init&gt;(Lorg/openqa/selenium/remote/ErrorCodes;Z)V

最近这几天就在学习appium,搭建环境就耗费了很多时间,不得不承认自己够笨的了,然后我把环境搭建好,写完脚本的时候,就报这个错了,当时是从某个群里直接下载的demo,不得不吐槽说,够坑的,是能跑通,你加了那么多jar包,这也没什么,主要是你把jar包名改了,这是我无法理解的.害得老子查这个报错,查了快一天,后来排除法才知道咋回事,报错如下: java.lang.NoSuchMethodError: org.openqa.selenium.remote.ErrorHandler.(Lorg/op

Selenium2学习-007-WebUI自动化实战实例-005-解决 Firefox 版本不兼容:org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary

此文主要讲述 Java 运行 Selenium 脚本时,因 Friefox 浏览器版本与 selenium-server-standalone-x.xx.x.jar 不兼容引起的 org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary 报错解决方法. 希望能对初学 Selenium2 WebUI 自动化测试编程的亲们有所帮助.若有不足之处,敬请大神指正,不胜感激! 之前给朋友初步介绍了 S

org.openqa.selenium.WebDriverException: f.QueryInterface is not a function Command duration or timeout:

今天偶遇一个问题,运行项目时,发现这个问题: org.openqa.selenium.WebDriverException: f.QueryInterface is not a functionCommand duration or timeout: 30.17 secondsBuild info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26

WebDriver:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

今天尝试最新的webDriver与fireFox搭配: 运行代码时出现如下的问题,但是浏览器却可以打开: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewPro

Selenium2学习-041-chromedriver:org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status from unexpected alert open

今天在写WebDriver处理弹出框(alert.confirm.prompt)演示实例脚本分发给朋友时,在其执行时未能成功执行,对应的部分错误详情如下: org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status from unexpected alert open (Session info: chrome=53.0.2785.116) (Driver info: chromed

(org.openqa.selenium.WebDriverException: Unable to launch the app: Error: Trying to start logcat capture but it&#39;s already started! )错误解决办法

新增: capabilities.setCapability("autoLaunch",false); 将setup中的: driver = new AndroidDriver(new URL("http://127.0.0.1:" + port + "/wd/hub"), capabilities); driver.launchApp(); 第二句: driver.launchApp() 注释掉 (org.openqa.selenium.Web

【Python + Selenium】初次用IE浏览器之报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.

初次用IE浏览器运行自动化程序时,报错:selenium.common.exceptions.WebDriverException: Message: 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