Search code examples
javaselenium-webdriverselenium-firefoxdriverwebdrivermanager-java

Web application cannot be launched with Firefox


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


Solution

    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