Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of Firefox and Chrome arguments/preferences

As a tester,
I would like to study a list of possible configuration arguments for Firefox and Chrome,
So that I can configure my testing tools with knowledge


Reading API indicates that there are methods with whom we can pass arguments to a webdriver instance:

FirefoxOptions.AddArgument
FirefoxOptions.SetLoggingPreference (inherited from DriverOptions)
FirefoxOptions.SetPreference

What exactly can be the possible arguments passed to these methods and what they do ?
Is there a resource online with a detailed list per each browser ?

like image 709
Kris Avatar asked Mar 01 '17 10:03

Kris


People also ask

Where are Firefox preferences?

In the Menu bar at the top of the screen, click Firefox and select Preferences. Click the menu button. and select Settings.

How do I use Firefox options in selenium?

FirefoxOptions options = new FirefoxOptions(); driver = new RemoteWebDriver(new URL("http://10.x.x.x:4444/wd/hub"), options); When you start your Selenium Nodes, it displays a log information on using new FirefoxOptions preferred to 'DesiredCapabilities. firefox() along with all other browser options.

What is FirefoxOptions?

The moz:firefoxOptions capability is a namespaced set of capabilities specific to Firefox. It is used to control the behavior of Firefox and can be used as a member of alwaysMatch or as a member of one of the firstMatch entries.


2 Answers

Resources for Firefox:
http://kb.mozillazine.org/About:config_entries
http://kb.mozillazine.org/Category:Preferences

Example usage:

firefoxProfile.setPreference("app.update.enabled", false);

Resources for Chrome:
https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/chrome_switches.cc?view=markup

Example usage:

chromeOptions.addArguments("--start-maximized");
like image 166
Kris Avatar answered Oct 20 '22 09:10

Kris


I`m currently using following arguments in Chrome. Hope this would help someone. The names of the arguments are easy to understand since it makes sense.

    ChromeOptions chromeOptions = new ChromeOptions();

    chromeOptions.addArguments("--headless");
    chromeOptions.addArguments("start-maximized");
    chromeOptions.addArguments("--disable-gpu");
    chromeOptions.addArguments("--start-fullscreen");
    chromeOptions.addArguments("--disable-extensions");
    chromeOptions.addArguments("--disable-popup-blocking");
    chromeOptions.addArguments("--disable-notifications");
    chromeOptions.addArguments("--window-size=1920,1080");
    chromeOptions.addArguments("--no-sandbox");
    chromeOptions.addArguments("--dns-prefetch-disable");
    chromeOptions.addArguments("enable-automation");
    chromeOptions.addArguments("disable-features=NetworkService");

    WebDriver driver = new ChromeDriver(chromeOptions);
like image 32
Dulith De Costa Avatar answered Oct 20 '22 08:10

Dulith De Costa