Unable to launch IE 11 when running selenium with IEDriverServer 3.9.0.0

前端 未结 1 1277
感动是毒
感动是毒 2021-01-24 19:37

I\'m having issues launching IE 11 when I run my selenium tests. Here is the code I am using to setup my browser

 if (browser.equalsIgnoreCase(\"ie\")) {
                


        
相关标签:
1条回答
  • 2021-01-24 20:38

    This error message...

    org.openqa.selenium.WebDriverException: java.net.SocketException: Connection reset
    

    ...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.12.0 of 2018-05-08T14:04:26.12Z which is almost an year older.
    • Your InternetExplorerDriver version 3.9.0.0.

    So there is a clear mismatch between the Selenium Client v3.12.0 and InternetExplorerDriver v3.9.0.0. As per best practices as Selenium Client and InternetExplorerDriver are released in sync you must use both the binaries from the same major release.


    Further InternetExplorerDriver server v3.9.0.0 had a known issue as per the following references:

    • Can't launch Selenium IE Driver after upgrading to version 3.9
    • Selenium Java Client (v3.9.1) with IEDriverServer v3.9.0.0 (64-bit) crashes with org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286

    This issue have been addressed through the following commit:

    • Properly initializing JSON values in IE driver

    Solution

    • Upgrade IEDriverServer to current IEDriverServer v3.12.0 level.
    • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
    • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
    • Take a System Reboot.
    • Execute your @Test.
    • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
    0 讨论(0)
提交回复
热议问题