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
DesiredCapabilities object. |
Constructor and Description |
---|
SafariOptions() |
Modifier and Type | Method and Description |
---|---|
static SafariOptions |
fromCapabilities(org.openqa.selenium.Capabilities capabilities)
Construct a
SafariOptions instance from given capabilites. |
int |
getPort() |
boolean |
getUseCleanSession() |
boolean |
getUseTechnologyPreview() |
SafariOptions |
setUseCleanSession(boolean useCleanSession)
Instruct the SafariDriver to delete all existing session data when starting a new session.
|
SafariOptions |
setUseTechnologyPreview(boolean useTechnologyPreview)
Instruct the SafariDriver to use the Safari Technology Preview if true, otherwise use the
release version of Safari.
|
amendHashCode, asMap, equals, getCapability, hashCode, merge, setCapability, setCapability, setCapability, setCapability, toString
public static final java.lang.String CAPABILITY
DesiredCapabilities
object.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 setUseCleanSession(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 int getPort()
SafariDriverService
should be started on.
If 0, the server should select a free port.setPort(int)
public boolean getUseCleanSession()
setUseCleanSession(boolean)
public boolean getUseTechnologyPreview()