If you are testing a web application on a WebDriver-based browser, you can customize and configure the browser session by setting the capabilities.
For information on the available options and capabilities for Mozilla Firefox 48 or later, see https://github.com/mozilla/geckodriver. For information on the available options and capabilities for Google Chrome, see Capabilities & ChromeOptions.
To set the capabilities in Silk4J:
For additional information, see Base State.
baseState.setConnectionString(
"moz:firefoxOptions="
+ "{"
+ " \"prefs\": {"
+ " \"browser.download.folderList\": 2,"
+ " \"browser.helperApps.neverAsk.saveToDisk\": \"application/octet-stream\"
+ " }"
+ "};");
baseState.setConnectionString("moz:firefoxOptions={\"prefs\": { \"browser.download.dir\" : \"C:/Download\"} };");
baseState.setConnectionString("moz:firefoxOptions={\"args\": [\"--devtools\"]};");
baseState.setConnectionString(
"chromeOptions="
+ "{"
+ " \"prefs\": {"
+ " \"profile.default_content_setting_values.automatic_downloads\":1,"
+ " \"download.default_directory\":\"c:\\\\Download\","
+ " \"download.prompt_for_download\":false"
+ " }"
+ "};");
baseState.setConnectionString(
"chromeOptions="
+ "{"
+ " \"args\":[\"--disable-save-password-bubble\"],"
+ " \"prefs\": {"
+ " \"profile.password_manager_enabled\": false,"
+ " \"credentials_enable_service\": false"
+ " }"
+ "};");