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
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.