0

Unable to launch Firefox.

Tried with Firefox 66.0 and Geckodriver geckodriver 0.24.0

Using Firefox 61.0 and Geckodriver geckodriver 0.21.0

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("webdriver.log.driver", "INFO");
profile.setPreference("webdriver.log.file", targetDir + File.separator + "firefoxSeleniumServer.log");
profile.setPreference("browser.download.folderList",2);
profile.setPreference("browser.download.manager.showWhenStarting",false);
profile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv;text/plain");
if(platform.equalsIgnoreCase("linux")) {
FirefoxOptions options = new FirefoxOptions();

profile.setPreference("browser.download.dir",System.getProperty("user.dir")+ File.separator + "target");
System.setProperty("webdriver.gecko.driver", "/geckodriver/geckodriver");
System.setProperty("webdriver.firefox.bin","/usr/bin/firefox/firefox");

options.setCapability(CapabilityType.PLATFORM_NAME,Platform.LINUX);
options.setCapability("marionette", true);
options.setCapability("webdriver.firefox.profile",DesiredCapabilities.firefox());
driver = new FirefoxDriver();
}

Session ID: 8d18af2e-b532-4991-af81-d446fb07bb6c at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

Caused by: java.lang.RuntimeException: There was an error in the forked process org.openqa.selenium.NoSuchSessionException

J.vik
  • 103
  • 2
  • 11

1 Answers1

0

As per this page 'https://github.com/mozilla/geckodriver/releases' v0.24.0' will support 65+ versions also. To overcome these version issues, you can try 'https://github.com/bonigarcia/webdrivermanager' where we don't require to add/ replace exe files for each browser.

Sreenivasulu
  • 494
  • 2
  • 7