0
votes

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?

1
How are you trying to launch Firefox? Using new/existing FirefoxProfile? What is your exact usecase?DebanjanB
I am trying to launch firefox using existing profile.I even tried without mentioning the profile statements but it did not work.Tripti Saigal
The exact use case is just to launch firefox and browse the url of my application.Tripti Saigal
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: FirefoxDriverTripti Saigal

1 Answers

0
votes

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.