问题
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 ?
回答1:
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");
回答2:
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);
来源:https://stackoverflow.com/questions/42529853/list-of-firefox-and-chrome-arguments-preferences