Selenium Webdriver启动边缘浏览器 [英] Selenium webdriver launching edge browser

查看:144
本文介绍了Selenium Webdriver启动边缘浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Edge浏览器有一个问题,下面是我的代码.浏览器打开,但控制权从不转到浏览器,而是执行停止并显示错误

I have an issue with Edge browser below is my code.The browser opens but control never goes to the browser instead execution halts and shows the error

service = new EdgeDriverService.Builder()
    .usingDriverExecutable(new File("C:\\Program Files (x86)\\Microsoft Web     Driver\\MicrosoftWebDriver.exe"))
         .usingAnyFreePort()
         .build();
          service.start();
          driver = new EdgeDriver(service, DesiredCapabilities.edge());

          driver.get("http://xyz.in");

在执行driver = new EdgeDriver(service, DesiredCapabilities.edge());行时,执行失败后将启动边缘浏览器,错误为

On executing the line driver = new EdgeDriver(service, DesiredCapabilities.edge()); edge browser is getting launched after that execution is failing with the error as

'FAILED: test
    org.openqa.selenium.remote.SessionNotFoundException: null (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 1.98 seconds
    Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52'
    System info: host: 'ODERWin10', ip: '192.168.1.119', os.name: 'Windows 8', os.arch: 'x86', os.version: '6.2', java.version: '1.7.0_13'
    Driver info: org.openqa.selenium.edge.EdgeDriver
        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:206)
        at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:164)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
        at org.openqa.selenium.edge.EdgeDriver.<init>(EdgeDriver.java:152)
        at Pack1.CrossBrowserTest.test(CrossBrowserTest.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)'

请提出解决方案,在此先感谢

Please suggest a solution, thanks in advance

推荐答案

我在SessionNotFoundException

  • Be sure to use the latest WebDriver for Windows Insiders from here https://www.microsoft.com/en-us/download/details.aspx?id=48740 (the normal one from here https://www.microsoft.com/en-us/download/confirmation.aspx?id=48212 does not work anymore on newer Windows 10 builds than 10240)
  • The 'Windows 8' display problem is as far as I know only a wrong output and not the root of the issue. Nonetheless it is fixed in selenium 2.49.0 (it's bug #669)

这篇关于Selenium Webdriver启动边缘浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆