public class SafariOptions
extends org.openqa.selenium.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(org.openqa.selenium.Capabilities source) |
Modifier and Type | Method and Description |
---|---|
protected int |
amendHashCode() |
java.util.Map<java.lang.String,java.lang.Object> |
asMap() |
static SafariOptions |
fromCapabilities(org.openqa.selenium.Capabilities capabilities)
Construct a
SafariOptions instance from given capabilites. |
boolean |
getUseTechnologyPreview() |
SafariOptions |
merge(org.openqa.selenium.Capabilities extraCapabilities) |
void |
setCapability(java.lang.String key,
boolean value) |
void |
setCapability(java.lang.String key,
java.lang.Object value) |
SafariOptions |
setProxy(org.openqa.selenium.Proxy proxy) |
SafariOptions |
setUseTechnologyPreview(boolean useTechnologyPreview)
Instruct the SafariDriver to use the Safari Technology Preview if true, otherwise use the
release version of Safari.
|
SafariOptions |
useCleanSession(boolean useCleanSession)
Deprecated.
SafariDriver always runs a clean session
|
public static final java.lang.String CAPABILITY
Capabilities
object.public SafariOptions()
public SafariOptions(org.openqa.selenium.Capabilities source)
public SafariOptions merge(org.openqa.selenium.Capabilities extraCapabilities)
merge
in interface org.openqa.selenium.Capabilities
merge
in class org.openqa.selenium.MutableCapabilities
public static SafariOptions fromCapabilities(org.openqa.selenium.Capabilities capabilities) throws org.openqa.selenium.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.org.openqa.selenium.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 org.openqa.selenium.MutableCapabilities
public void setCapability(java.lang.String key, boolean value)
setCapability
in class org.openqa.selenium.MutableCapabilities
public SafariOptions setProxy(org.openqa.selenium.Proxy proxy)
public boolean getUseTechnologyPreview()
protected int amendHashCode()
public java.util.Map<java.lang.String,java.lang.Object> asMap()
asMap
in interface org.openqa.selenium.Capabilities
asMap
in class org.openqa.selenium.MutableCapabilities