Class FirefoxOptions

  • All Implemented Interfaces:
    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);
     
    • Field Detail

    • Constructor Detail

      • FirefoxOptions

        public FirefoxOptions()
      • FirefoxOptions

        public FirefoxOptions​(org.openqa.selenium.Capabilities source)
    • Method Detail

      • 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​(java.nio.file.Path path)
      • setBinary

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

        public FirefoxBinary getBinary()
        Constructs a FirefoxBinary and returns that to be used, and because of this is only useful when actually starting firefox.
      • 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)
      • setHeadless

        public FirefoxOptions setHeadless​(boolean headless)
      • setCapability

        public void setCapability​(java.lang.String key,
                                  java.lang.Object value)
        Overrides:
        setCapability in class org.openqa.selenium.MutableCapabilities
      • asMap

        public java.util.Map<java.lang.String,​java.lang.Object> asMap()
        Specified by:
        asMap in interface org.openqa.selenium.Capabilities
        Overrides:
        asMap in class org.openqa.selenium.MutableCapabilities
      • 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
      • amendHashCode

        protected int amendHashCode()
        Overrides:
        amendHashCode in class org.openqa.selenium.MutableCapabilities