Web application cannot be launched with Firefox

93 Views Asked by At

I have given following code to launch the application with Firefox

System.setProperty("webdriver.gecko.driver",
"C:/Work/Assessment/Automation/Test_2/src/main/resources/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://google.com");

I get below error:

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line

I want to launch the application with the Firefox browser

2

There are 2 best solutions below

0
On
  1. Check if you have the Firefox browser installed
  2. Use the Boni Garcia WebDriverManager
  3. Update your Selenium version to the latest
2
On
  1. Please upgrade your firefox driver with latest version.

FireFox driver link : Firefox driver download link

Note: Firefox browser version is same as firefox driver version