Class DriverOptions


  • public class DriverOptions
    extends Object
    Options for WebDriver.

    If you want to add new options, read the IConfig documentation.

    • Constructor Detail

      • DriverOptions

        public DriverOptions()
        Constructs empty options.
      • DriverOptions

        public DriverOptions​(IConfig config)
        Constructs driver options specified by command line.
        Parameters:
        config - configuration information.
      • DriverOptions

        public DriverOptions​(DriverOptions other)
        Constructs clone of DriverOptions.
        Parameters:
        other - other DriverOptions.
    • Method Detail

      • getBoolean

        public boolean getBoolean​(DriverOptions.DriverOption opt)
        Get option value as boolean.
        Parameters:
        opt - option key.
        Returns:
        option value.
      • has

        public boolean has​(DriverOptions.DriverOption opt)
        DriverOptions instance has specified option.
        Parameters:
        opt - option key.
        Returns:
        true if has specified option.
      • set

        public DriverOptions set​(DriverOptions.DriverOption opt,
                                 String... values)
        Set option key and value.
        Parameters:
        opt - option key.
        values - option values. (multiple values are accepted by DEFINE, CLI_ARGS, and CHROME_EXTENSION only)
        Returns:
        this.
      • addDefinitions

        public DriverOptions addDefinitions​(String... defs)
        Add "define" parameters.
        Parameters:
        defs - definitions.
        Returns:
        this.
      • getCliArgs

        public String[] getCliArgs()
        Get CLI arguments for starting up driver.
        Returns:
        CLI arguments.
      • getChromeExtensions

        public List<File> getChromeExtensions()
        Get Chrome Extensions for starting up driver.
        Returns:
        Chrome Extension files.
      • getEnvVars

        public Map<String,​String> getEnvVars()
        Get environment variables map.
        Returns:
        environment variables map.
      • getCapabilities

        public org.openqa.selenium.remote.DesiredCapabilities getCapabilities()
        Get desired capabilities.
        Returns:
        desired capabilities.