org.openqa.selenium.NoSuchWindowException:尝试通过Selenium和IEDriverServer打开Internet Explorer 11时无法获取浏览器 [英] org.openqa.selenium.NoSuchWindowException: Unable to get browser while trying to open Internet Explorer 11 through Selenium and IEDriverServer

查看:172
本文介绍了org.openqa.selenium.NoSuchWindowException:尝试通过Selenium和IEDriverServer打开Internet Explorer 11时无法获取浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用Selenium Webdriver启动Internet Explorer浏览器.面对以下错误,任何人都可以帮忙

I'm unable to launch Internet Explorer browser with the selenium webdriver. Facing the below error, can anyone please help

发生错误:

Started InternetExplorerDriver server (32-bit)
3.14.0.0
Listening on port 45640
Only local connections are allowed
Aug 06, 2019 3:32:27 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Exception in thread "main" org.openqa.selenium.NoSuchWindowException: Unable to get browser
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'A13540', ip: '10.40.75.65', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: false, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:45640/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}
Session ID: ddba15a7-0a39-45cb-89d5-e6023ff636da

推荐答案

此错误消息...

Exception in thread "main" org.openqa.selenium.NoSuchWindowException: Unable to get browser

...表示 IEDriverServer 无法启动/产生新的 WebBrowsing会话,即 InternetExplorer Browser 会话.

...implies that the IEDriverServer was unable to initiate/spawn a new WebBrowsing Session i.e. InternetExplorer Browser session.

您的主要问题是所使用的二进制文件版本之间的不兼容性:

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • 您的 Selenium Client 版本是 3.141.59 .
  • 您的 InternetExplorerDriver 版本 3.14.0.0 .
  • 您的 JDK版本 1.8.0_60 ,非常古老.
  • Your Selenium Client version is 3.141.59.
  • Your InternetExplorerDriver version 3.14.0.0.
  • Your JDK version is 1.8.0_60 which is pretty ancient.

因此 Selenium Client v3.141.59 InternetExplorerDriver v3.14.0.0 JDK v8u60 之间存在明显的不匹配.根据最佳实践 Selenium Client InternetExplorerDriver 同步发布,您必须使用同一发行版中的两个二进制文件.

So there is a clear mismatch between the Selenium Client v3.141.59, InternetExplorerDriver v3.14.0.0 and JDK v8u60. As per best practices as Selenium Client and InternetExplorerDriver are released in sync and you must use both the binaries from the same release.

  • JDK 升级到当前级别 JDK 8u212 .
  • IEDriverServer 升级到当前的 IEDriverServer v3.141.59 级别.
  • 通过 IDE
  • 清理您的项目工作区重建您的项目,并且仅具有必需的依赖项.
  • 执行您的@Test.
  • Upgrade JDK to current levels JDK 8u212.
  • Upgrade IEDriverServer to current IEDriverServer v3.141.59 level.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Execute your @Test.

这篇关于org.openqa.selenium.NoSuchWindowException:尝试通过Selenium和IEDriverServer打开Internet Explorer 11时无法获取浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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