【问题标题】:Facing issue with IE 11 on windows 10, browser is launched but does not enter URL在 Windows 10 上面临 IE 11 的问题,浏览器已启动但未输入 URL
【发布时间】:2018-01-09 13:04:26
【问题描述】:

硒代码:

System.setProperty("webdriver.ie.driver","D:\\Automation\\Drivers\\IEDriverServer.exe");
DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability("ignoreZoomSetting", true);
WebDriver driver = new InternetExplorerDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
Thread.sleep(3000);
driver.get("http://google.co.in");

错误:

Started InternetExplorerDriver server (64-bit)
3.8.0.0
Listening on port 25160
Only local connections are allowed
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: session null does not exist (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'TS-39', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'

【问题讨论】:

  • 任何时候浏览器启动但没有输入 URL,你应该做的第一件事是确保你的 Selenium 驱动程序和浏览器是最新的(或者至少匹配版本,如果你'已故意降级)。

标签: selenium selenium-webdriver selenium-iedriver


【解决方案1】:

错误说明了一切:

org.openqa.selenium.remote.SessionNotFoundException: session null does not exist

原因

您看到SessionNotFoundException的主要原因是以下原因:

  • 您使用的是 3.8.0.0 版本的 InternetExplorerDriver,从下面的日志中可以明显看出该驱动程序已正确启动。

    Started InternetExplorerDriver server (64-bit)
    3.8.0.0
    Listening on port 25160
    Only local connections are allowed
    
  • 但是您的 Selenium 版本是 2.53.1,从下面的日志中可以看出:

    Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
    
  • 此外,您的 JDK 版本比 1.8.0_91 版本旧得多,这从以下日志中可以看出:

    System info: host: 'TS-39', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
    

解决方案

简单的解决方案是:

  • 将您的 JDK 版本更新到当前级别 JDK (Java SE 9.0.1)
  • 将您的 Selenium-Java Client 版本更新到当前级别 v3.8.1
  • 将您的 InternetExplorerDriver 版本更新到当前级别 v3.8.0.0
  • 执行您的Test

【讨论】:

    猜你喜欢
    • 2016-04-20
    • 2013-04-04
    • 2013-09-22
    • 2017-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-16
    • 2014-05-26
    相关资源
    最近更新 更多