Kris
Kris

Reputation: 503

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?

Upvotes: 12

Views: 34677

Answers (2)

Kris
Kris

Reputation: 503

Resources for Firefox:
https://kb.mozillazine.org/About:config_entries
https://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");

Upvotes: 19

Du-Lacoste
Du-Lacoste

Reputation: 12787

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);

Upvotes: 5

Related Questions