public class OperaOptions extends Object
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);
 // or alternatively:
 DesiredCapabilities capabilities = DesiredCapabilities.opera();
 capabilities.setCapability(OperaOptions.CAPABILITY, options);
 OperaDriver driver = new OperaDriver(capabilities);
 // For use with RemoteWebDriver:
 DesiredCapabilities capabilities = DesiredCapabilities.opera();
 capabilities.setCapability(ChromeOptions.CAPABILITY, options);
 RemoteWebDriver driver = new RemoteWebDriver(
     new URL("http://localhost:4444/wd/hub"), capabilities);
 | Modifier and Type | Field and Description | 
|---|---|
static String | 
CAPABILITY
Key used to store a set of OperaOptions in a  
DesiredCapabilities
 object. | 
| Constructor and Description | 
|---|
OperaOptions()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addArguments(List<String> arguments)
Adds additional command line arguments to be used when starting Opera. 
 | 
void | 
addArguments(String... arguments)  | 
void | 
addEncodedExtensions(List<String> encoded)
Adds a new Opera extension to install on browser startup. 
 | 
void | 
addEncodedExtensions(String... encoded)  | 
void | 
addExtensions(File... paths)  | 
void | 
addExtensions(List<File> paths)
Adds a new Opera extension to install on browser startup. 
 | 
boolean | 
equals(Object other)  | 
Object | 
getExperimentalOption(String name)
Returns the value of an experimental option. 
 | 
int | 
hashCode()  | 
void | 
setBinary(File path)
Sets the path to the Opera executable. 
 | 
void | 
setBinary(String path)
Sets the path to the Opera executable. 
 | 
void | 
setExperimentalOption(String name,
                     Object value)
Sets an experimental option. 
 | 
com.google.gson.JsonElement | 
toJson()
Converts this instance to its JSON representation. 
 | 
public static final String CAPABILITY
DesiredCapabilities
 object.public void setBinary(File path)
path - Path to Opera executable.public void setBinary(String path)
path - Path to Opera executable.public void addArguments(String... arguments)
arguments - The arguments to use when starting Opera.addArguments(java.util.List)public void addArguments(List<String> arguments)
   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 delimitted with an "=": "foo=bar".
arguments - The arguments to use when starting Opera.public void addExtensions(File... paths)
paths - Paths to the extensions to install.addExtensions(java.util.List)public void addExtensions(List<File> paths)
paths - Paths to the extensions to install.public void addEncodedExtensions(String... encoded)
encoded - Base64 encoded data of the extensions to install.addEncodedExtensions(java.util.List)public void addEncodedExtensions(List<String> encoded)
encoded - Base64 encoded data of the extensions to install.public void setExperimentalOption(String name, Object value)
OperaOptions API.name - Name of the experimental option.value - Value of the experimental option, which must be convertible
     to JSON.public Object getExperimentalOption(String name)
name - The option name.null if not set.public com.google.gson.JsonElement toJson()
                                   throws IOException
IOException - If an error occurs while reading the
     extension files from disk.Copyright © 2016. All rights reserved.