Since upgrading to the latest version of Selenium the following code seems to be deprecated:
Selenium 3.6.0 & webdriver = new FirefoxDriver(capabilities) - deprecated?
Full code:
System.setProperty("webdriver.gecko.driver", Base_Page.getConstant(Constant.GECKO_DRIVER_DIRECTORY));
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
webdriver = new FirefoxDriver(capabilities); //deprecated
Selenium 4 is the latest version of selenium; Simon Stewart founder of selenium has announced Selenium 4 at the Selenium Conference in Bangalore which consists of few major updates and its planned to release after October 2019 (even though official announcement yet to get).
In selenium 3, the latest version till date is 3.141. Selenium 3.
Selenium automates web browsers. It is most famous for enabling rapid, repeatable web-app testing, which allows developers to ship new releases faster and with confidence.
In Selenium 3, the chrome driver class directly extends to the Remote Web Driver. But In Selenium 4 Chrome driver class extends to Chromium Driver, which has some predefined methods to access the dev tool.
From https://raw.githubusercontent.com/SeleniumHQ/selenium/master/rb/CHANGES
3.4.1 (2017-06-13)
==================
Firefox:
* Added new Firefox::Options class that should be used to customize browser
behavior (command line arguments, profile, preferences, Firefox binary, etc.).
The instance of options class can be passed to driver initialization using
:options key. Old way of passing these customization directly to driver
initialization is deprecated.
From the 3.4.1 version the FirefoxOptions should be used.
Changed the following code 'FirefoxDriver(capabilities)
to firefoxOptions
which uses .setCapcability()
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setCapability("marionette", true);
webdriver = new FirefoxDriver(firefoxOptions);
Try following:
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(firefoxOptions);
You can try this line;
FirefoxOptions ffOpt = new FirefoxOptions();
ffOpt.setCapabilities("marionette", true);
WebDriver driver = new FirefoxDriver(ffOpt);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With