Class 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 Detail

    • Constructor Detail

      • FirefoxOptions

        public FirefoxOptions()
      • FirefoxOptions

        public FirefoxOptions​(org.openqa.selenium.Capabilities source)
    • 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
      • getBinary

        public FirefoxBinary getBinary()
        Constructs a FirefoxBinary and returns that to be used, and because of this is only useful when actually starting firefox.
      • setBinary

        public FirefoxOptions setBinary​(java.nio.file.Path path)
      • setBinary

        public FirefoxOptions setBinary​(java.lang.String path)
      • getBinaryOrNull

        public java.util.Optional<FirefoxBinary> getBinaryOrNull()
      • 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)
      • 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)
      • getExtraCapabilityNames

        protected java.util.Set<java.lang.String> getExtraCapabilityNames()
        Specified by:
        getExtraCapabilityNames in class org.openqa.selenium.remote.AbstractDriverOptions<FirefoxOptions>
      • getExtraCapability

        protected java.lang.Object getExtraCapability​(java.lang.String capabilityName)
        Specified by:
        getExtraCapability in class org.openqa.selenium.remote.AbstractDriverOptions<FirefoxOptions>
      • merge

        public FirefoxOptions merge​(org.openqa.selenium.Capabilities capabilities)
        Specified by:
        merge in interface org.openqa.selenium.Capabilities
        Overrides:
        merge in class org.openqa.selenium.MutableCapabilities