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 Deprecated 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)FirefoxOptionsconfigureFromEnv()Configures the following: Binarywebdriver.firefox.bin- the path to the firefox binary Firefox profilewebdriver.firefox.profile- a named firefox profileFirefoxBinarygetBinary()Constructs aFirefoxBinaryand returns that to be used, and because of this is only useful when actually starting firefox.java.util.Optional<FirefoxBinary>getBinaryOrNull()protected java.lang.ObjectgetExtraCapability(java.lang.String capabilityName)protected java.util.Set<java.lang.String>getExtraCapabilityNames()FirefoxProfilegetProfile()booleanisLegacy()Deprecated.This method will be deleted and will not be replaced.FirefoxOptionsmerge(org.openqa.selenium.Capabilities capabilities)FirefoxOptionssetAndroidActivity(java.lang.String activity)FirefoxOptionssetAndroidDeviceSerialNumber(java.lang.String serial)FirefoxOptionssetAndroidIntentArguments(java.lang.String[] args)FirefoxOptionssetAndroidIntentArguments(java.util.List<java.lang.String> args)FirefoxOptionssetAndroidPackage(java.lang.String androidPackage)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)Deprecated.This method will be deleted and will not be replaced.FirefoxOptionssetLogLevel(FirefoxDriverLogLevel logLevel)FirefoxOptionssetProfile(FirefoxProfile profile)-
Methods inherited from class org.openqa.selenium.remote.AbstractDriverOptions
asMap, getCapability, getCapabilityNames, setAcceptInsecureCerts, setBrowserVersion, setImplicitWaitTimeout, setPageLoadStrategy, setPageLoadTimeout, setPlatformName, setProxy, setScriptTimeout, setStrictFileInteractability, setUnhandledPromptBehaviour
-
Methods inherited from class org.openqa.selenium.MutableCapabilities
equals, hashCode, setCapability, setCapability, setCapability, toJson, toString
-
-
-
-
Field Detail
-
FIREFOX_OPTIONS
public static final java.lang.String FIREFOX_OPTIONS
- See Also:
- Constant Field Values
-
-
Method Detail
-
configureFromEnv
public FirefoxOptions configureFromEnv()
Configures the following:- Binary
webdriver.firefox.bin- the path to the firefox binary- Firefox profile
webdriver.firefox.profile- a named firefox profile
-
setLegacy
@Deprecated public FirefoxOptions setLegacy(boolean legacy)
Deprecated.This method will be deleted and will not be replaced.
-
isLegacy
@Deprecated public boolean isLegacy()
Deprecated.This method will be deleted and will not be replaced.
-
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)
-
setAndroidPackage
public FirefoxOptions setAndroidPackage(java.lang.String androidPackage)
-
setAndroidActivity
public FirefoxOptions setAndroidActivity(java.lang.String activity)
-
setAndroidDeviceSerialNumber
public FirefoxOptions setAndroidDeviceSerialNumber(java.lang.String serial)
-
setAndroidIntentArguments
public FirefoxOptions setAndroidIntentArguments(java.lang.String[] args)
-
setAndroidIntentArguments
public FirefoxOptions setAndroidIntentArguments(java.util.List<java.lang.String> args)
-
setCapability
public void setCapability(java.lang.String key, java.lang.Object value)- Overrides:
setCapabilityin classorg.openqa.selenium.MutableCapabilities
-
getExtraCapabilityNames
protected java.util.Set<java.lang.String> getExtraCapabilityNames()
- Specified by:
getExtraCapabilityNamesin classorg.openqa.selenium.remote.AbstractDriverOptions<FirefoxOptions>
-
getExtraCapability
protected java.lang.Object getExtraCapability(java.lang.String capabilityName)
- Specified by:
getExtraCapabilityin classorg.openqa.selenium.remote.AbstractDriverOptions<FirefoxOptions>
-
merge
public FirefoxOptions merge(org.openqa.selenium.Capabilities capabilities)
- Specified by:
mergein interfaceorg.openqa.selenium.Capabilities- Overrides:
mergein classorg.openqa.selenium.MutableCapabilities
-
-