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

查看:36
本文介绍了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 客户端 版本是 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.59InternetExplorerDriver v3.14.0.0JDK v8u60 之间存在明显的不匹配.根据最佳实践Selenium ClientInternetExplorerDriver 是同步发布的,您必须使用同一版本中的两个二进制文件.

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 升级到当前级别 JDK8u212.
  • IEDriverServer 升级到当前的 IEDriverServerv3.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天全站免登陆