I'm working on Chrome with Selenium and I'm looking to change a few settings within Chrome using the webdriver. Using Google and this site, I was able to get most of the settings working. However, a few more seem to escape me and hopefully I can get the answers here. I'm looking to alter the settings before launching the browser, such as using
ChromeOptions, rather than using automation to navigate the settings page.
These 4 are giving me the most issues. Any help?Answer1:
Perhaps this <a href="http://peter.sh/experiments/chromium-command-line-switches/" rel="nofollow">List of Chromium Command Line Switches</a> will help. E.g.
Map<String, Object> preferences = Maps.newHashMap(); preferences.put( "browser.startup.homepage", "http://my.home.page" ); preferences.put( "browser.startup.page", START_WITH_HOME_PAGE ); capabilities.setCapability( ChromeOptions.CAPABILITY, preferences ); ChromeDriver driver = new ChromeDriver( capabilities );
My guess is that the following
from <a href="http://dev.chromium.org/administrators/configuring-other-preferences" rel="nofollow">Configuring other parameters</a> will cause Chrome to ask you to select a search engine when it opens.