public class BrowserConfigurationOptions
extends java.lang.Object
Selenium.start()
. The parameters
set within will override any command-line parameters set for the same option.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BROWSER_EXECUTABLE_PATH |
static java.lang.String |
BROWSER_MODE |
static java.lang.String |
COMMAND_LINE_FLAGS |
static int |
DEFAULT_TIMEOUT_IN_SECONDS |
static java.lang.String |
MULTI_WINDOW |
static java.lang.String |
PROFILE_NAME |
static java.lang.String |
PROXY_CONFIG |
static java.lang.String |
SINGLE_WINDOW |
static java.lang.String |
TIMEOUT_IN_SECONDS |
Constructor and Description |
---|
BrowserConfigurationOptions()
Instantiate a blank BrowserConfigurationOptions instance.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canUse(java.lang.String value) |
java.lang.String |
get(java.lang.String key) |
protected java.lang.String |
getBrowserExecutablePath() |
protected java.lang.String |
getBrowserMode() |
java.lang.String |
getCommandLineFlags() |
protected java.lang.String |
getProfile() |
protected int |
getTimeoutInSeconds() |
boolean |
hasOptions()
Returns true if any options are set in this instance.
|
protected boolean |
isMultiWindow()
Returns true if the
MULTI_WINDOW field is set. |
boolean |
isSet(java.lang.String key) |
protected boolean |
isSingleWindow()
Returns true if the
SINGLE_WINDOW field is set. |
java.lang.String |
serialize()
Serializes to the format "name=value;name=value".
|
BrowserConfigurationOptions |
set(java.lang.String key,
java.lang.String value)
Sets the given key to the given value unless the value is null.
|
BrowserConfigurationOptions |
setBrowserExecutablePath(java.lang.String executablePath)
Sets the full path for the browser executable.
|
BrowserConfigurationOptions |
setBrowserMode(java.lang.String mode)
Sets the "mode" for the browser.
|
BrowserConfigurationOptions |
setCommandLineFlags(java.lang.String cmdLineFlags) |
BrowserConfigurationOptions |
setMultiWindow()
Sets
MULTI_WINDOW and unsets SINGLE_WINDOW |
BrowserConfigurationOptions |
setProfile(java.lang.String profile)
Sets the name of the profile, which must exist in the -profilesLocation directory, to use for
this browser session.
|
BrowserConfigurationOptions |
setSingleWindow()
Sets
SINGLE_WINDOW and unsets MULTI_WINDOW . |
BrowserConfigurationOptions |
setTimeoutInSeconds(int timeout)
Sets the timeout, in seconds, for all commands.
|
java.lang.String |
toString()
Returns the serialization of this object, as defined by the serialize() method.
|
public static final java.lang.String PROXY_CONFIG
public static final java.lang.String PROFILE_NAME
public static final java.lang.String SINGLE_WINDOW
public static final java.lang.String MULTI_WINDOW
public static final java.lang.String BROWSER_EXECUTABLE_PATH
public static final java.lang.String TIMEOUT_IN_SECONDS
public static final java.lang.String BROWSER_MODE
public static final java.lang.String COMMAND_LINE_FLAGS
public static final int DEFAULT_TIMEOUT_IN_SECONDS
public BrowserConfigurationOptions()
public boolean hasOptions()
public java.lang.String serialize()
public BrowserConfigurationOptions setProfile(java.lang.String profile)
profile
- the name of the profile.protected java.lang.String getProfile()
protected boolean isSingleWindow()
SINGLE_WINDOW
field is set.SINGLE_WINDOW
is set.protected boolean isMultiWindow()
MULTI_WINDOW
field is set.MULTI_WINDOW
is set.public BrowserConfigurationOptions setSingleWindow()
SINGLE_WINDOW
and unsets MULTI_WINDOW
.public BrowserConfigurationOptions setMultiWindow()
MULTI_WINDOW
and unsets SINGLE_WINDOW
protected java.lang.String getBrowserExecutablePath()
public BrowserConfigurationOptions setBrowserExecutablePath(java.lang.String executablePath)
executablePath
- the full path for the browser executable.public BrowserConfigurationOptions setTimeoutInSeconds(int timeout)
timeout
- the timeout for all commandsprotected int getTimeoutInSeconds()
public BrowserConfigurationOptions setBrowserMode(java.lang.String mode)
mode
- protected java.lang.String getBrowserMode()
public BrowserConfigurationOptions setCommandLineFlags(java.lang.String cmdLineFlags)
public java.lang.String getCommandLineFlags()
protected boolean canUse(java.lang.String value)
public boolean isSet(java.lang.String key)
public java.lang.String get(java.lang.String key)
public BrowserConfigurationOptions set(java.lang.String key, java.lang.String value)
key
- the name of the keyvalue
- the value for the keypublic java.lang.String toString()
toString
in class java.lang.Object