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. |
int |
getPort()
Deprecated.
Getters are not needed in browser Options classes.
|
boolean |
getUseCleanSession()
Deprecated.
Getters are not needed in browser Options classes.
|
boolean |
getUseTechnologyPreview()
Deprecated.
Getters are not needed in browser Options classes.
|
SafariOptions |
merge(org.openqa.selenium.Capabilities extraCapabilities) |
SafariOptions |
setProxy(org.openqa.selenium.Proxy proxy) |
SafariOptions |
setUseCleanSession(boolean useCleanSession)
Deprecated.
Use
useCleanSession(boolean) instead |
SafariOptions |
setUseTechnologyPreview(boolean useTechnologyPreview)
Deprecated.
Create a
SafariDriverService to specify what Safari flavour should be used
and pass the service instance to a SafariDriver constructor. |
SafariOptions |
useCleanSession(boolean useCleanSession)
Instruct the SafariDriver to delete all existing session data when starting a new session.
|
setCapability, setCapability, setCapability, setCapability
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 optionspublic 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.@Deprecated public SafariOptions setUseCleanSession(boolean useCleanSession)
useCleanSession(boolean)
instead@Deprecated public SafariOptions setUseTechnologyPreview(boolean useTechnologyPreview)
SafariDriverService
to specify what Safari flavour should be used
and pass the service instance to a SafariDriver
constructor.useTechnologyPreview
- If true, the SafariDriver will use the Safari Technology Preview,
otherwise will use the release version of Safari.public SafariOptions setProxy(org.openqa.selenium.Proxy proxy)
@Deprecated public int getPort()
SafariDriverService
should be started on.
If 0, the server should select a free port.setPort(int)
@Deprecated public boolean getUseCleanSession()
setUseCleanSession(boolean)
@Deprecated 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