WebDriver 调用ie浏览器报错(转)

报错信息如下:
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: ‘2.31.0‘, revision: ‘1bd294d‘, time: ‘2013-02-27 20:53:56‘
System info: os.name: ‘Windows XP‘, os.arch: ‘x86‘, os.version: ‘5.1‘, java.version: ‘1.6.0_23‘
Driver info: driver.version: InternetExplorerDriver
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:201)
        at org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:105)
        at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:51)
        at com.example.tests.test.main(test.java:27)
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: ‘2.31.0‘, revision: ‘1bd294d‘, time: ‘2013-02-27 20:53:56‘
System info: os.name: ‘Windows XP‘, os.arch: ‘x86‘, os.version: ‘5.1‘, java.version: ‘1.6.0_23‘
Driver info: driver.version: InternetExplorerDriver
        at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:165)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:62)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
        ... 5 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:35700/status] to be available after 20553 ms
        at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
        at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:163)
        ... 7 more
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
        at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
        at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79)
        ... 8 more
Caused by: java.util.concurrent.TimeoutException
        at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:130)
        ... 9 more

解决:

You will need InternetExplorer driver executable on your system. So download it from the hinted source (http://code.google.com/p/selenium/downloads/list) unpack it and place somewhere you can find it. In my example, I will assume you will place it to C:\Selenium\iexploredriver.exe

Then you have to set it up in the system. Here is the Java code pasted from my Selenium project:

File file = new File("C:/Selenium/iexploredriver.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
WebDriver driver = new InternetExplorerDriver();

时间: 2024-08-24 23:04:05

WebDriver 调用ie浏览器报错(转)的相关文章

webdriver调用ie浏览器报错

webdriver调用ie浏览器报错: org.openqa.selenium.NoSuchWindowException: Unable to find element on closed 解决方法: System.setProperty("webdriver.ie.driver", "C:\\Users\\ssatyanarayana\\Downloads\\IEDriverServer.exe"); // opening the IE with recomen

selenium调用IE浏览器报错

开始学习写第一个自动化脚步时,调用IE浏览器运行报错,如下图 原因:本地IE使用的是IE9,win7上的IE7及以上版本必须在IE internet选项的安全页,4个区域的的启用保护模式必须一致(要么全勾选,要么全不勾选),本地IE4个保护模式没有保持一致,因此报错. 解决方案:IE9 internet选项的安全页,4个区域的的启用保护模式设置一致即可,如下图 具体可以查看selenium官方文档:https://github.com/SeleniumHQ/selenium/wiki/Inter

ie7/8浏览器报错:对象不支持&ldquo;trim&rdquo;属性或方法

解决方法: 方法1: 使用jquery里面的全局函数$.trim()代替原生js方法trim(): $.trim( 你要替换的字符 ); 方法2: Function.prototype.method = function (name, func) { this.prototype[name] = func; return this; }; if (!String.prototype.trim) { //判断下浏览器是否自带有trim()方法 String.method('trim', funct

C# 调用win32 DLL报错 System.BadImageFormatException

C# 调用win32 DLL报错  System.BadImageFormatException 项目右键属性->项目设计器->生成->平台->把'默认设置(任何 CPU)'改为x86. 因为'任何 CPU'的程序在64位的机器上就会用运行为64位,而64程序是不能加载32位dll的

调用系统命令 system-config-kickstart 报错,解决办法如下

[[email protected] ~]# system-config-kickstart Xlib:  extension "RANDR" missing on display "localhost:10.0". /usr/share/system-config-kickstart/kickstartGui.py:103: GtkWarning: GtkSpinButton: setting an adjustment with non-zero page si

PHP多次调用Mysql存储过程报错解决办法

PHP多次调用Mysql数据库的存储过程会出现问题,主要问题为存储过程中执行多次SQL语句不能一一释放导致的,网上找了一些解决办法,比如使用 multi_query 然后一个一个释放,但是发现根本不适合我们的项目,我们使用CI框架写的,更多的是使用CI的数据库处理方法.所以只能另辟蹊径. 一次偶然,把Mysql链接方式改成了mysqli,两种不同的PHP连接mysql的扩展,官方在高版本中推荐使用mysqli,结果却奇迹般好了,使用Mysql长连接也行,天意么? PHP多次调用Mysql存储过程

Windows 7上打开IE浏览器报错:无法启动此程序,因为计算机中丢失api-ms-win-core-path-|1-1-0.dll。尝试重新安装该程序以解决此问题。

Windows 7上打开IE浏览器报错: 1. 重新安装IE11也没有解决该问题 2. 在其他Win7电脑也搜索不到该文件,但是能使用IE浏览器. 3. 从网上找了一个dll文件,注册时提示如下图

Chrome浏览器报错:Origin null is not allowed by Access-Control-Allow-Origin.

问题:Chrome浏览器报错:Origin null is not allowed by Access-Control-Allow-Origin. 原因:.js文件中使用load()方法,而Chrome浏览器出于安全起见,不允许load本地文件. 方法:给Chrome添加启动参数--allow-file-access-from-files. 步骤:右击Chrome浏览器快捷方式,选择“属性”,在“目标”中加上"--allow-file-access-from-files",注意前面有个

Bug集锦-Spring Cloud Feign调用其它接口报错

问题描述 Spring Cloud Feign调用其它服务报错,错误提示如下:Failed to instantiate [java.util.List]: Specified class is an interface. 解决方案 通过查询一些资料,得到的结论,是定义接口传递的参数时,没有用@RequestBody修饰,查看定义接口有用@RequestBogy修饰,Feign的接口实现里没有用@RequestBody修饰,添加后问题就解决了,以后还是要仔细看待每个问题. 原文地址:https: