Class OperaOptions

  • All Implemented Interfaces:
    java.io.Serializable, Capabilities

    @Deprecated
    public class OperaOptions
    extends AbstractDriverOptions<OperaOptions>
    Deprecated.
    Use ChromeDriver with ChromiumOptions.setBinary(File) or ChromiumOptions.setBinary(String) to set the path to the Opera browser.

    Example usage:

    
     ChromeOptions options = new ChromeOptions()
     options.setBinary(new File("/path/to/opera"));
    
     // For using Opera browser with ChromeDriver:
     ChromeDriver driver = new ChromeDriver(options);
    
     // For use with RemoteWebDriver:
     ChromeOptions options = new ChromeOptions();
     options.setBinary(new File("/path/to/opera"));
     RemoteWebDriver driver = new RemoteWebDriver(
         new URL("http://localhost:4444/"), options);
     
    Class to manage options specific to OperaDriver.

    Example usage:

    
     OperaOptions options = new OperaOptions()
     options.addExtensions(new File("/path/to/extension.crx"))
     options.setBinary(new File("/path/to/chrome"));
    
     // For use with OperaDriver:
     OperaDriver driver = new OperaDriver(options);
    
     // For use with RemoteWebDriver:
     OperaOptions options = new OperaOptions();
     RemoteWebDriver driver = new RemoteWebDriver(
         new URL("http://localhost:4444/"), options);
     
    Since operadriver does not support w3c, Selenium will remove the support in the next version.
    See Also:
    Serialized Form
    • Field Detail

      • CAPABILITY

        public static final java.lang.String CAPABILITY
        Deprecated.
        Key used to store a set of OperaOptions in a Capabilities object.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OperaOptions

        public OperaOptions()
        Deprecated.
    • Method Detail

      • setBinary

        public OperaOptions setBinary​(java.io.File path)
        Deprecated.
        Sets the path to the Opera executable. This path should exist on the machine which will launch Opera. The path should either be absolute or relative to the location of running OperaDriver server.
        Parameters:
        path - Path to Opera executable.
      • setBinary

        public OperaOptions setBinary​(java.lang.String path)
        Deprecated.
        Sets the path to the Opera executable. This path should exist on the machine which will launch Opera. The path should either be absolute or relative to the location of running OperaDriver server.
        Parameters:
        path - Path to Opera executable.
      • addArguments

        public OperaOptions addArguments​(java.lang.String... arguments)
        Deprecated.
        Parameters:
        arguments - The arguments to use when starting Opera.
        See Also:
        addArguments(java.util.List)
      • addArguments

        public OperaOptions addArguments​(java.util.List<java.lang.String> arguments)
        Deprecated.
        Adds additional command line arguments to be used when starting Opera.

        For example:

        
           options.setArguments(
               "load-extension=/path/to/unpacked_extension",
               "allow-outdated-plugins");
         

        Each argument may contain an option "--" prefix: "--foo" or "foo". Arguments with an associated value should be delimited with an "=": "foo=bar".

        Parameters:
        arguments - The arguments to use when starting Opera.
      • addExtensions

        public OperaOptions addExtensions​(java.util.List<java.io.File> paths)
        Deprecated.
        Adds a new Opera extension to install on browser startup. Each path should specify a packed Opera extension (CRX file).
        Parameters:
        paths - Paths to the extensions to install.
      • addEncodedExtensions

        public OperaOptions addEncodedExtensions​(java.util.List<java.lang.String> encoded)
        Deprecated.
        Adds a new Opera extension to install on browser startup. Each string data should specify a Base64 encoded string of packed Opera extension (CRX file).
        Parameters:
        encoded - Base64 encoded data of the extensions to install.
      • setExperimentalOption

        public OperaOptions setExperimentalOption​(java.lang.String name,
                                                  java.lang.Object value)
        Deprecated.
        Sets an experimental option. Useful for new OperaDriver options not yet exposed through the OperaOptions API.
        Parameters:
        name - Name of the experimental option.
        value - Value of the experimental option, which must be convertible to JSON.
      • getExperimentalOption

        public java.lang.Object getExperimentalOption​(java.lang.String name)
        Deprecated.
        Returns the value of an experimental option.
        Parameters:
        name - The option name.
        Returns:
        The option value, or null if not set.