Selenium调用IE出错SessionNotCreatedException
从头到尾看了几遍官方文档,也把IEDriverServer.exe加入了PATH,也试过
File file = new File("C:\\IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
这样加载,代码就一句:
public class Test {
public static void main(String[] args) {
WebDriver driver = new InternetExplorerDriver();
}
}
但是报错
Listening on port 30697
Only local connections are allowed
十月 20, 2016 3:33:31 下午 org.openqa.selenium.remote.ProtocolHandshake createSession
信息: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
十月 20, 2016 3:33:32 下午 org.openqa.selenium.remote.ProtocolHandshake createSession
信息: Falling back to original OSS JSON Wire Protocol.
十月 20, 2016 3:33:32 下午 org.openqa.selenium.remote.ProtocolHandshake createSession
信息: Falling back to straight W3C remote end connection
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'WIN-3DLUDLJN43H', ip: '10.0.2.15', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_112'
Driver info: driver.version: InternetExplorerDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:227)
at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:180)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:172)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:144)
at Fuck.main(Fuck.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Process finished with exit code 1
试了很多windows版本和IE版本,selenium3.0和3.0.1都试了,java8环境64位,快疯了跪求大神
相关阅读:
必应搜索建议api
webpack配置,页面没有自动刷新,求帮忙看看
mac vagrant add box报错
返回到上一页时如何强制刷新
最近在测试NDK的时候一直挂在libc
npm install全局安装出错,请问如何解决?谢谢!
请教如何实现让微信服务号支持两个不同的银行帐户。
Python小白用Scrapy爬虫返回的是空元素,请问各位大神哪里出了问题?
html 这种表格排版是怎么弄呢?
mac下的idea如何格式化代码?
node mysql连接池
audio缓冲区间的问题
laravel中添加数据的使用使用valdiate验证数据是否在关系表中存在
react写轮播组件
h5做的app图片渲染性能优化
活动表如何设计呢?
webPack的作用就是把多个js合并成一个?
我的reduce放到index.jsx上出错了
ionic项目启动后白屏
css右边是图片左边是竖立的文字