0

I am using Selenium 3.12,gecko driver version-21 and i have Firefox-61 installed on my system.

I am trying to launch Firefox using the code below:

System.setProperty("java.net.preferIPv4Stack" , "true");
System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "\\geckodriver.exe");
FirefoxOptions options = new FirefoxOptions();
options.setCapability("marionette", true);
options.setLogLevel(FirefoxDriverLogLevel.TRACE);
options.setBinary("C:\\Program Files\\Mozilla Firefox\\firefox.exe");
ProfilesIni profile = new ProfilesIni();
FirefoxProfile fxProfile = profile.getProfile("xyzProfile");
fxProfile.setPreference(FirefoxProfile.PORT_PREFERENCE,7056);
driver = new FirefoxDriver(options);

However i am getting the below error and not able to even launch the browser-

org.openqa.selenium.WebDriverException: java.net.SocketException: Software caused connection abort: recv failed Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z' System info: host: 'INDA201695', ip: '10.164.59.166', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131' Driver info: driver.version: FirefoxDriver

Please help as to what is causing this error and how can i fix the same?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Tripti Saigal
  • 21
  • 1
  • 3
  • How are you `trying to launch Firefox`? Using new/existing `FirefoxProfile`? What is your exact usecase? – undetected Selenium Aug 10 '18 at 09:32
  • I am trying to launch firefox using existing profile.I even tried without mentioning the profile statements but it did not work. – Tripti Saigal Aug 13 '18 at 05:30
  • The exact use case is just to launch firefox and browse the url of my application. – Tripti Saigal Aug 13 '18 at 05:38
  • Check this discussion https://stackoverflow.com/questions/49683355/cannot-resolve-constructor-firefoxdriverorg-openqa-selenium-firefox-firefoxprof – undetected Selenium Aug 13 '18 at 05:42
  • I tried with the code mentioned on this link. But still i am unable to launch firefox and getting the error message while debugging: org.openqa.selenium.WebDriverException: java.net.SocketException: Software caused connection abort: recv failed Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z' System info: host: 'INDA201695', ip: '10.164.59.166', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131' Driver info: driver.version: FirefoxDriver – Tripti Saigal Aug 16 '18 at 11:14

1 Answers1

0

This error message...

org.openqa.selenium.WebDriverException: java.net.SocketException: Software caused connection abort: recv failed 
 Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z' 
 System info: host: 'INDA201695', ip: '10.164.59.166', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131' 
 Driver info: driver.version: FirefoxDriver

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

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

  • Your JDK version is 1.8.0_131 which is pretty ancient.

So there is a clear mismatch between the JDK v8u131 and other binaries.

Solution

  • Upgrade JDK to recent levels JDK 8u181.
  • Upgrade Selenium to current levels Version 3.14.0.
  • Upgrade GeckoDriver to GeckoDriver v0.20.1 level.
  • Ensure GeckoDriver is present in the specified location.
  • Ensure GeckoDriver is having executable permission for non-root users.
  • Upgrade Firefox version to Firefox v61.0.2 levels.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Execute your Test as a non-root user.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352