public class SafariOptions extends MutableCapabilities
SafariDriver
.
Example usage:
SafariOptions options = new SafariOptions()
options.setUseCleanSession(true);
// For use with SafariDriver:
SafariDriver driver = new SafariDriver(options);
// For use with RemoteWebDriver:
RemoteWebDriver driver = new RemoteWebDriver(
new URL("http://localhost:4444/wd/hub"),
options);
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CAPABILITY
Key used to store SafariOptions in a
Capabilities object. |
Constructor and Description |
---|
SafariOptions() |
SafariOptions(Capabilities source) |
Modifier and Type | Method and Description |
---|---|
protected int |
amendHashCode()
Subclasses can use this to add information that isn't always in the capabilities map.
|
java.util.Map<java.lang.String,java.lang.Object> |
asMap() |
boolean |
equals(java.lang.Object o) |
static SafariOptions |
fromCapabilities(Capabilities capabilities)
Construct a
SafariOptions instance from given capabilites. |
java.lang.Object |
getCapability(java.lang.String capabilityName) |
Platform |
getPlatform() |
boolean |
getUseTechnologyPreview() |
int |
hashCode() |
SafariOptions |
merge(Capabilities extraCapabilities)
Merges the extra capabilities provided into this DesiredCapabilities instance.
|
void |
setCapability(java.lang.String key,
boolean value) |
void |
setCapability(java.lang.String key,
java.lang.Object value) |
SafariOptions |
setProxy(Proxy proxy) |
SafariOptions |
setUseTechnologyPreview(boolean useTechnologyPreview)
Instruct the SafariDriver to use the Safari Technology Preview if true, otherwise use the
release version of Safari.
|
java.util.Map<java.lang.String,java.lang.Object> |
toJson() |
java.lang.String |
toString() |
SafariOptions |
useCleanSession(boolean useCleanSession)
Deprecated.
SafariDriver always runs a clean session
|
setCapability, setCapability
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBrowserName, getVersion, is, isJavascriptEnabled
public static final java.lang.String CAPABILITY
Capabilities
object.public SafariOptions()
public SafariOptions(Capabilities source)
public SafariOptions merge(Capabilities extraCapabilities)
MutableCapabilities
merge
in interface Capabilities
merge
in class MutableCapabilities
extraCapabilities
- Additional capabilities to be added.public static SafariOptions fromCapabilities(Capabilities capabilities) throws WebDriverException
SafariOptions
instance from given capabilites.
When the CAPABILITY
capability is set, all other capabilities will be ignored!capabilities
- Desired capabilities from which the options are derived.WebDriverException
- If an error occurred during the reconstruction of the options@Deprecated public SafariOptions useCleanSession(boolean useCleanSession)
Warning: Since Safari uses a single profile for the current user, enabling this capability will permanently erase any existing session data.
useCleanSession
- If true, the SafariDriver will erase all existing session data.public SafariOptions setUseTechnologyPreview(boolean useTechnologyPreview)
useTechnologyPreview
- If true, the SafariDriver will use the Safari Technology Preview,
otherwise will use the release version of Safari.public void setCapability(java.lang.String key, java.lang.Object value)
setCapability
in class MutableCapabilities
public void setCapability(java.lang.String key, boolean value)
setCapability
in class MutableCapabilities
public SafariOptions setProxy(Proxy proxy)
public boolean getUseTechnologyPreview()
protected int amendHashCode()
public java.util.Map<java.lang.String,java.lang.Object> asMap()
asMap
in interface Capabilities
public Platform getPlatform()
getPlatform
in interface Capabilities
public java.lang.Object getCapability(java.lang.String capabilityName)
getCapability
in interface Capabilities
capabilityName
- The capability to return.CapabilityType
public java.util.Map<java.lang.String,java.lang.Object> toJson()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object