|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.opera.core.systems.OperaSettings
public class OperaSettings
Manages settings specific to OperaDriver.
OperaSettings serves as the internal storage for OperaDriver related settings and as a converter
between DesiredCapabilities and other internal resources.
Example usage:
OperaSettings settings = new OperaSettings();
settings.setBinary(new File("/path/to/opera"));
settings.arguments().add("foo", "bar");
settings.logging().getLevel(Level.FINE);
For use with OperaDriver:
OperaDriver driver = new OperaDriver(settings);
For use with RemoteWebDriver:
DesiredCapabilities capabilities = DesiredCapabilities.opera();
capabilities.merge(settings.toCapabilities());
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),
capabilities);
| Nested Class Summary | |
|---|---|
static class |
OperaSettings.Builder
Supplier of an OperaSettings instance with the ability to specify which OperaSettings.Builder.usingProfile(OperaProfile) to use. |
static class |
OperaSettings.Capability
The capabilities specifically available to Opera. |
class |
OperaSettings.OperaLogging
Manages settings related to logging in OperaDriver and related processes, such as
OperaRunner and Opera itself. |
| Constructor Summary | |
|---|---|
OperaSettings()
Constructs a new set of settings for OperaDriver and Opera to use. |
|
OperaSettings(OperaProfile profile)
Constructs a new set of settings for OperaDriver and Opera to use based on the given
profile. |
|
| Method Summary | |
|---|---|
OperaArguments |
arguments()
Gets the arguments passed on to Opera. |
boolean |
autostart()
Whether or not Opera should be launched on initialization. |
void |
autostart(boolean enabled)
Enable or disable whether Opera should be launched on initialization. |
String |
getBackend()
Deprecated. |
File |
getBinary()
Returns the browser binary executable. |
Integer |
getDisplay()
Gets the X display used. |
String |
getHost()
Returns the Scope server host the debugger should connect to. |
File |
getLauncher()
Gets the launcher to use with OperaLauncherRunner, if any. |
int |
getPort()
Gets the port the debugger should connect to. |
OperaProduct |
getProduct()
Returns the product currently used, for example OperaProduct.DESKTOP or OperaProduct.CORE. |
boolean |
hasDetach()
Whether to detach the Opera browser when the driver shuts down. |
OperaSettings.OperaLogging |
logging()
Returns the OperaSettings.OperaLogging interface for managing logging levels and logging to file for
OperaDriver. |
OperaSettings |
merge(org.openqa.selenium.Capabilities capabilities)
Merge a set of capabilities in to these settings. |
boolean |
noRestart()
Deprecated. |
void |
noRestart(boolean enabled)
Deprecated. |
OperaProfile |
profile()
Returns an OperaProfile object containing all settings related to the Opera profile to
be used. |
void |
setBackend(String backend)
Deprecated. |
void |
setBinary(File binary)
Sets Opera's binary executable location. |
void |
setDetach(boolean enabled)
Specifies whether to detach the Opera browser when the driver shuts down. |
void |
setDisplay(int display)
Sets the X display to use. |
void |
setHost(String ip)
Specifies which Scope server the debugger should connect to. |
void |
setIdle(boolean enabled)
Whether to use Opera's alternative implicit wait implementation. |
void |
setLauncher(File launcherBinary)
Specifies launcher to use. |
void |
setPort(int port)
Specifies the port the debugger should connect to. |
void |
setProduct(OperaProduct product)
Sets the product currently used, for example desktop or core. |
void |
setProfile(OperaProfile profile)
Sets the profile to use as an Opera profile represented as an object. |
void |
setProfile(String profileDirectory)
Sets the directory to use for the Opera profile. |
boolean |
supportsDebugProxy()
Whether or not the currently specified Opera configuration supports the -debugproxy command-line argument. |
boolean |
supportsPd()
Whether or not the currently specified Opera configuration supports the -pd
command-line argument. |
org.openqa.selenium.Capabilities |
toCapabilities()
Returns this as capabilities. |
org.json.JSONObject |
toJson()
Converts this instance to its JSON representation. |
String |
toString()
String representation of the Opera specific settings. |
boolean |
useIdle()
Whether to use Opera's alternative implicit wait implementation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OperaSettings()
OperaDriver and Opera to use. The default
settings are populated from OperaSettings.Capability.
public OperaSettings(OperaProfile profile)
OperaDriver and Opera to use based on the given
profile.
profile - the profile to use| Method Detail |
|---|
public OperaSettings.OperaLogging logging()
OperaSettings.OperaLogging interface for managing logging levels and logging to file for
OperaDriver.
public File getBinary()
public void setBinary(File binary)
binary - the Opera binarypublic OperaArguments arguments()
public String getHost()
public void setHost(String ip)
ip - IP address (hostnames are not allowed) to the Scope serverpublic int getPort()
public void setPort(int port)
port - local port number for the debugger to connect topublic File getLauncher()
OperaLauncherRunner, if any. If autostart() is
false the launcher will not be used. If not set, this method will return the default location
of the launcher on your system.
public void setLauncher(File launcherBinary)
throws IOException
autostart() is false, it will not be used.
launcherBinary - the launcher binary
IOException - if there is a problem with the provided launcherpublic OperaProfile profile()
OperaProfile object containing all settings related to the Opera profile to
be used. This might be anything from the path to the profile directory, to preferences used
in Opera.
public void setProfile(String profileDirectory)
profileDirectory - the path to the profile directorypublic void setProfile(OperaProfile profile)
profile - the Opera profile to usepublic boolean useIdle()
public void setIdle(boolean enabled)
enabled - to enable or disable idlepublic Integer getDisplay()
public void setDisplay(int display)
display - the X display to use
UnsupportedOperationException - if on a non-GNU/Linux operating systempublic boolean autostart()
OperaDriver
will wait and listen for an incoming Scope client connection.
public void autostart(boolean enabled)
OperaDriver will wait and listen for incoming an incoming Scope client connection. This
cannot be set during runtime. This is true by default.
enabled - true if Opera should be started automatically, false otherwisepublic OperaProduct getProduct()
OperaProduct.DESKTOP or OperaProduct.CORE.
public void setProduct(OperaProduct product)
product - the profile configuration to use@Deprecated public boolean noRestart()
OperaDesktopDriver. It is false by default.
@Deprecated public void noRestart(boolean enabled)
OperaDesktopDriver.
enabled - true if Opera should be restart, false otherwisepublic boolean hasDetach()
public void setDetach(boolean enabled)
enabled - true will leave Opera running, false will shut down Opera along with driver@Deprecated public String getBackend()
OperaLauncherRunner (i.e. if autostart() and getLauncher() are specified).
Warning: This is a temporary workaround for launcher not taking external
window-only screenshots on Windows.
@Deprecated public void setBackend(String backend)
OperaLauncherRunner (i.e. if autostart() and getLauncher() are specified).
Warning: This is a temporary workaround for launcher not taking external
window-only screenshots on Windows.
backend - the backend to use for gogi, either "software" or "hardware"public boolean supportsDebugProxy()
-debugproxy command-line argument. If the specified port is not equal to the
default proxy server port specified in OperaIntervals.SERVER_DEFAULT_PORT,
this will be true.
-debugproxy command-line argument,
false otherwisepublic boolean supportsPd()
-pd
command-line argument. PD stands for personal directory, and refers to a
profile for Opera.
-pd command-line argument.public OperaSettings merge(org.openqa.selenium.Capabilities capabilities)
opera. capability prefix will be updated, while surplus/unknown capabilities will be
stored. They can later be retrieved using the toCapabilities() method on this object.
- Parameters:
capabilities - capabilities to merge into these settings
- Returns:
- reference to self
public org.openqa.selenium.Capabilities toCapabilities()
public org.json.JSONObject toJson()
throws IOException,
org.json.JSONException
IOException - if an I/O error occurs
org.json.JSONException - if an error occurs while encoding these settings as JSONpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||