org.openqa.selenium.NoSuchWindowException: Unable to get browser while trying to open Internet Explorer 11 through Selenium and IEDriverServer

耗尽温柔 提交于 2020-03-11 14:53:08

问题


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

Error occured:

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

回答1:


This error message...

Exception in thread "main" org.openqa.selenium.NoSuchWindowException: Unable to get 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:

  • 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.

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.


Solution

  • 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.



回答2:


Few points to check: 1. Check for security settings. Enable protected mode for all Options "Internet, Local Internet, Trusted Sites, Restricted sites" must not be selected. 2. Check for iedriverserver.exe(for IE 11 3.14) version compatibility.

Thanks and regards, Sandeep Jaju



来源:https://stackoverflow.com/questions/57373685/org-openqa-selenium-nosuchwindowexception-unable-to-get-browser-while-trying-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!