selenium java session_selenium,java_Selenium调用IE出错SessionNotCreatedException,selenium,java,自动化测试 - p...

在使用Selenium 3.0.1与Java进行自动化测试时,遇到SessionNotCreatedException错误,尝试了设置IEDriverServer路径、调整Windows和IE版本,但问题依然存在。代码中通过InternetExplorerDriver初始化时报错,可能是由于环境配置或兼容性问题。寻求大神帮助解决此异常。
摘要由CSDN通过智能技术生成

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右边是图片左边是竖立的文字

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值