public class FirefoxOptions extends MutableCapabilities
An example of usage:
FirefoxOptions options = new FirefoxOptions() .addPreference("browser.startup.page", 1) .addPreference("browser.startup.homepage", "https://www.google.co.uk"); WebDriver driver = new FirefoxDriver(options);
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FIREFOX_OPTIONS |
Constructor and Description |
---|
FirefoxOptions() |
FirefoxOptions(Capabilities source) |
Modifier and Type | Method and Description |
---|---|
FirefoxOptions |
addArguments(java.util.List<java.lang.String> arguments) |
FirefoxOptions |
addArguments(java.lang.String... arguments) |
FirefoxOptions |
addPreference(java.lang.String key,
boolean value) |
FirefoxOptions |
addPreference(java.lang.String key,
int value) |
FirefoxOptions |
addPreference(java.lang.String key,
java.lang.String value) |
protected int |
amendHashCode()
Subclasses can use this to add information that isn't always in the capabilities map.
|
java.util.Map<java.lang.String,java.lang.Object> |
asMap() |
boolean |
equals(java.lang.Object o) |
FirefoxBinary |
getBinary()
Constructs a
FirefoxBinary and returns that to be used, and because of this is only
useful when actually starting firefox. |
java.util.Optional<FirefoxBinary> |
getBinaryOrNull() |
java.lang.Object |
getCapability(java.lang.String capabilityName) |
Platform |
getPlatform() |
FirefoxProfile |
getProfile() |
int |
hashCode() |
boolean |
isLegacy() |
FirefoxOptions |
merge(Capabilities capabilities)
Merges the extra capabilities provided into this DesiredCapabilities instance.
|
FirefoxOptions |
setAcceptInsecureCerts(boolean acceptInsecureCerts) |
FirefoxOptions |
setBinary(FirefoxBinary binary) |
FirefoxOptions |
setBinary(java.nio.file.Path path) |
FirefoxOptions |
setBinary(java.lang.String path) |
void |
setCapability(java.lang.String key,
java.lang.Object value) |
FirefoxOptions |
setHeadless(boolean headless) |
FirefoxOptions |
setLegacy(boolean legacy) |
FirefoxOptions |
setLogLevel(FirefoxDriverLogLevel logLevel) |
FirefoxOptions |
setLogLevel(java.util.logging.Level logLevel)
Deprecated.
|
FirefoxOptions |
setPageLoadStrategy(PageLoadStrategy strategy) |
FirefoxOptions |
setProfile(FirefoxProfile profile) |
FirefoxOptions |
setProxy(Proxy proxy) |
FirefoxOptions |
setUnhandledPromptBehaviour(UnexpectedAlertBehaviour behaviour) |
java.util.Map<java.lang.String,java.lang.Object> |
toJson() |
java.lang.String |
toString() |
setCapability, setCapability, setCapability
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBrowserName, getVersion, is, isJavascriptEnabled
public static final java.lang.String FIREFOX_OPTIONS
public FirefoxOptions()
public FirefoxOptions(Capabilities source)
public FirefoxOptions setLegacy(boolean legacy)
public boolean isLegacy()
public FirefoxOptions setBinary(FirefoxBinary binary)
public FirefoxOptions setBinary(java.nio.file.Path path)
public FirefoxOptions setBinary(java.lang.String path)
public FirefoxBinary getBinary()
FirefoxBinary
and returns that to be used, and because of this is only
useful when actually starting firefox.public java.util.Optional<FirefoxBinary> getBinaryOrNull()
public FirefoxOptions setProfile(FirefoxProfile profile)
public FirefoxProfile getProfile()
public FirefoxOptions addArguments(java.lang.String... arguments)
public FirefoxOptions addArguments(java.util.List<java.lang.String> arguments)
public FirefoxOptions addPreference(java.lang.String key, boolean value)
public FirefoxOptions addPreference(java.lang.String key, int value)
public FirefoxOptions addPreference(java.lang.String key, java.lang.String value)
@Deprecated public FirefoxOptions setLogLevel(java.util.logging.Level logLevel)
setLogLevel(FirefoxDriverLogLevel)
public FirefoxOptions setLogLevel(FirefoxDriverLogLevel logLevel)
public FirefoxOptions setPageLoadStrategy(PageLoadStrategy strategy)
public FirefoxOptions setUnhandledPromptBehaviour(UnexpectedAlertBehaviour behaviour)
public FirefoxOptions setAcceptInsecureCerts(boolean acceptInsecureCerts)
public FirefoxOptions setHeadless(boolean headless)
public FirefoxOptions setProxy(Proxy proxy)
public void setCapability(java.lang.String key, java.lang.Object value)
setCapability
in class MutableCapabilities
public java.util.Map<java.lang.String,java.lang.Object> asMap()
asMap
in interface Capabilities
public FirefoxOptions merge(Capabilities capabilities)
MutableCapabilities
merge
in interface Capabilities
merge
in class MutableCapabilities
capabilities
- Additional capabilities to be added.protected int amendHashCode()
public Platform getPlatform()
getPlatform
in interface Capabilities
public java.lang.Object getCapability(java.lang.String capabilityName)
getCapability
in interface Capabilities
capabilityName
- The capability to return.CapabilityType
public java.util.Map<java.lang.String,java.lang.Object> toJson()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object