Package org.openqa.selenium.firefox
Class FirefoxOptions
- java.lang.Object
-
- org.openqa.selenium.MutableCapabilities
-
- org.openqa.selenium.remote.AbstractDriverOptions<FirefoxOptions>
-
- org.openqa.selenium.firefox.FirefoxOptions
-
- All Implemented Interfaces:
java.io.Serializable,org.openqa.selenium.Capabilities
public class FirefoxOptions extends org.openqa.selenium.remote.AbstractDriverOptions<FirefoxOptions>
Manage firefox specific settings in a way that geckodriver can understand.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);- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFIREFOX_OPTIONS
-
Constructor Summary
Constructors Constructor Description FirefoxOptions()FirefoxOptions(org.openqa.selenium.Capabilities source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FirefoxOptionsaddArguments(java.lang.String... arguments)FirefoxOptionsaddArguments(java.util.List<java.lang.String> arguments)FirefoxOptionsaddPreference(java.lang.String key, java.lang.Object value)protected intamendHashCode()java.util.Map<java.lang.String,java.lang.Object>asMap()booleanequals(java.lang.Object arg0)FirefoxBinarygetBinary()Constructs aFirefoxBinaryand returns that to be used, and because of this is only useful when actually starting firefox.java.util.Optional<FirefoxBinary>getBinaryOrNull()java.lang.ObjectgetCapability(java.lang.String arg0)java.util.Set<java.lang.String>getCapabilityNames()org.openqa.selenium.PlatformgetPlatform()FirefoxProfilegetProfile()inthashCode()booleanisLegacy()FirefoxOptionsmerge(org.openqa.selenium.Capabilities capabilities)FirefoxOptionssetBinary(java.lang.String path)FirefoxOptionssetBinary(java.nio.file.Path path)FirefoxOptionssetBinary(FirefoxBinary binary)voidsetCapability(java.lang.String key, java.lang.Object value)FirefoxOptionssetHeadless(boolean headless)FirefoxOptionssetLegacy(boolean legacy)FirefoxOptionssetLogLevel(FirefoxDriverLogLevel logLevel)FirefoxOptionssetProfile(FirefoxProfile profile)java.util.Map<java.lang.String,java.lang.Object>toJson()java.lang.StringtoString()-
Methods inherited from class org.openqa.selenium.remote.AbstractDriverOptions
setAcceptInsecureCerts, setPageLoadStrategy, setProxy, setStrictFileInteractability, setUnhandledPromptBehaviour
-
Methods inherited from class org.openqa.selenium.MutableCapabilities
setCapability, setCapability, setCapability
-
-
-
-
Field Detail
-
FIREFOX_OPTIONS
public static final java.lang.String FIREFOX_OPTIONS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setLegacy
public FirefoxOptions setLegacy(boolean legacy)
-
isLegacy
public boolean isLegacy()
-
setBinary
public FirefoxOptions setBinary(FirefoxBinary binary)
-
setBinary
public FirefoxOptions setBinary(java.nio.file.Path path)
-
setBinary
public FirefoxOptions setBinary(java.lang.String path)
-
getBinary
public FirefoxBinary getBinary()
Constructs aFirefoxBinaryand returns that to be used, and because of this is only useful when actually starting firefox.
-
getBinaryOrNull
public java.util.Optional<FirefoxBinary> getBinaryOrNull()
-
setProfile
public FirefoxOptions setProfile(FirefoxProfile profile)
-
getProfile
public FirefoxProfile getProfile()
-
addArguments
public FirefoxOptions addArguments(java.lang.String... arguments)
-
addArguments
public FirefoxOptions addArguments(java.util.List<java.lang.String> arguments)
-
addPreference
public FirefoxOptions addPreference(java.lang.String key, java.lang.Object value)
-
setLogLevel
public FirefoxOptions setLogLevel(FirefoxDriverLogLevel logLevel)
-
setHeadless
public FirefoxOptions setHeadless(boolean headless)
-
setCapability
public void setCapability(java.lang.String key, java.lang.Object value)- Overrides:
setCapabilityin classorg.openqa.selenium.MutableCapabilities
-
asMap
public java.util.Map<java.lang.String,java.lang.Object> asMap()
- Specified by:
asMapin interfaceorg.openqa.selenium.Capabilities
-
merge
public FirefoxOptions merge(org.openqa.selenium.Capabilities capabilities)
- Specified by:
mergein interfaceorg.openqa.selenium.Capabilities- Overrides:
mergein classorg.openqa.selenium.MutableCapabilities
-
amendHashCode
protected int amendHashCode()
-
getPlatform
public org.openqa.selenium.Platform getPlatform()
- Specified by:
getPlatformin interfaceorg.openqa.selenium.Capabilities
-
getCapability
public java.lang.Object getCapability(java.lang.String arg0)
- Specified by:
getCapabilityin interfaceorg.openqa.selenium.Capabilities
-
getCapabilityNames
public java.util.Set<java.lang.String> getCapabilityNames()
- Specified by:
getCapabilityNamesin interfaceorg.openqa.selenium.Capabilities
-
toJson
public java.util.Map<java.lang.String,java.lang.Object> toJson()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object arg0)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-