Class ChromiumOptions<T extends ChromiumOptions<?>>
java.lang.Object
org.openqa.selenium.MutableCapabilities
org.openqa.selenium.remote.AbstractDriverOptions<ChromiumOptions<?>>
org.openqa.selenium.chromium.ChromiumOptions<T>
- All Implemented Interfaces:
Serializable, org.openqa.selenium.Capabilities
public class ChromiumOptions<T extends ChromiumOptions<?>>
extends org.openqa.selenium.remote.AbstractDriverOptions<ChromiumOptions<?>>
Class to manage options specific to
ChromiumDriver.
Example usage:
ChromeOptions options = new ChromeOptions()
options.addExtensions(new File("/path/to/extension.crx"))
options.setBinary(new File("/path/to/chrome"));
// For use with ChromeDriver:
ChromeDriver driver = new ChromeDriver(options);
// For use with RemoteWebDriver:
RemoteWebDriver driver = new RemoteWebDriver(
new URL("http://localhost:4444/"),
new ChromeOptions());
- Since:
- Since chromedriver v17.0.963.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionChromiumOptions(String capabilityType, String browserType, String capability) -
Method Summary
Modifier and TypeMethodDescriptionaddArguments(String... arguments) addArguments(List<String> arguments) Adds additional command line arguments to be used when starting Chrome.addEncodedExtensions(String... encoded) addEncodedExtensions(List<String> encoded) Adds a new Chrome extension to install on browser startup.addExtensions(File... paths) addExtensions(List<File> paths) Adds a new Chrome extension to install on browser startup.protected @Nullable ObjectgetExtraCapability(String capabilityName) protected voidmergeInOptionsFromCaps(String capabilityName, org.openqa.selenium.Capabilities capabilities) protected voidmergeInPlace(org.openqa.selenium.Capabilities capabilities) protected Tself()setAndroidActivity(String activity) setAndroidDeviceSerialNumber(String serial) setAndroidPackage(String androidPackage) setAndroidProcess(String processName) Process name of the Activity hosting the WebView (as given by ps).Sets the path to the Chrome executable.Sets the path to the Chrome executable.setExperimentalOption(String name, Object value) Sets an experimental option.setUseRunningAndroidApp(boolean useIt) Methods inherited from class org.openqa.selenium.remote.AbstractDriverOptions
asMap, getCapability, getCapabilityNames, setAcceptInsecureCerts, setBrowserVersion, setEnableDownloads, setImplicitWaitTimeout, setPageLoadStrategy, setPageLoadTimeout, setPlatformName, setProxy, setScriptTimeout, setStrictFileInteractability, setUnhandledPromptBehaviourMethods inherited from class org.openqa.selenium.MutableCapabilities
equals, hashCode, merge, setCapability, setCapability, setCapability, setCapability, toJson, toStringMethods inherited from interface org.openqa.selenium.Capabilities
get, getBrowserName, getBrowserVersion, getPlatformName, is, required
-
Constructor Details
-
ChromiumOptions
-
-
Method Details
-
setBinary
-
setBinary
-
addArguments
-
addArguments
Adds additional command line arguments to be used when starting Chrome. For example:options.addArguments( "load-extension=/path/to/unpacked_extension", "allow-outdated-plugins");Each argument may contain an optional "--" prefix: "--foo" or "foo". Arguments with an associated value should be delimited with an "=": "foo=bar".
- Parameters:
arguments- The arguments to use when starting Chrome.
-
addExtensions
-
addExtensions
-
addEncodedExtensions
-
addEncodedExtensions
-
enableBiDi
-
setExperimentalOption
Sets an experimental option. Useful for new ChromeDriver options not yet exposed through theChromiumOptionsAPI.- Parameters:
name- Name of the experimental option.value- Value of the experimental option, which must be convertible to JSON.
-
setAndroidPackage
-
setAndroidActivity
-
setAndroidDeviceSerialNumber
-
setUseRunningAndroidApp
-
setAndroidProcess
-
self
-
getExtraCapabilityNames
- Specified by:
getExtraCapabilityNamesin classorg.openqa.selenium.remote.AbstractDriverOptions<ChromiumOptions<?>>
-
getExtraCapability
- Specified by:
getExtraCapabilityin classorg.openqa.selenium.remote.AbstractDriverOptions<ChromiumOptions<?>>
-
mergeInPlace
protected void mergeInPlace(org.openqa.selenium.Capabilities capabilities) -
mergeInOptionsFromCaps
protected void mergeInOptionsFromCaps(String capabilityName, org.openqa.selenium.Capabilities capabilities)
-