Firefox browser is not opening with selenium webbrowser code [duplicate] Firefox browser is not opening with selenium webbrowser code [duplicate] selenium selenium

Firefox browser is not opening with selenium webbrowser code [duplicate]


You are using latest version of Selenium WebDriver i.e. Selenium 3.x, this version of webdriver doesn't support direct firefox launch. You have to set the SystemProperty for webdriver.gecko.driver.

Replace the Code:-

WebDriver driver;driver =new FirefoxDriver();

With This code:-

WebDriver driver;System.setProperty("webdriver.gecko.driver", "<Path to your WebDriver>");driver =new FirefoxDriver();

You can get the information about latest changes here

You can download the latest Gecko driver from here


Download the lastest version for geckoDriver here then set a System property called "webdriver.gecko.driver" and put on it the path to your geckoDriver executable pathSystem.setProperty("webdriver.gecko.driver", "<path to your gecko driver executable>");


Firefox driver is based on marionette starting with Selenium 3.0. Unlike, 2.x versions, it requires an external executable file. You should add it to your path. For more information, you should have a look at https://github.com/mozilla/geckodriver.