public class SafariOptions
extends java.lang.Object
SafariDriver
.
Example usage:
SafariOptions options = new SafariOptions()
options.setUseCleanSession(true);
// For use with SafariDriver:
SafariDriver driver = new SafariDriver(options);
// For use with RemoteWebDriver:
DesiredCapabilities capabilities = DesiredCapabilities.safari();
capabilities.setCapability(SafariOptions.CAPABILITY, options);
RemoteWebDriver driver = new RemoteWebDriver(
new URL("http://localhost:4444/wd/hub"), capabilities);
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 |
---|---|
void |
addExtensions(java.io.File... paths)
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
void |
addExtensions(java.util.List<java.io.File> paths)
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
boolean |
equals(java.lang.Object other) |
static SafariOptions |
fromCapabilities(Capabilities capabilities)
Construct a
SafariOptions instance from given capabilites. |
com.google.common.base.Optional<java.io.File> |
getDataDir()
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
java.util.List<java.io.File> |
getExtensions()
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
int |
getPort() |
boolean |
getSkipExtensionInstallation()
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
boolean |
getUseCleanSession() |
boolean |
getUseCustomDriverExtension()
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
int |
hashCode() |
void |
setDataDir(java.io.File dataDir)
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
void |
setDriverExtension(java.io.File driverExtension)
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
void |
setPort(int port)
Set the port the
SafariDriverServer should be started on. |
void |
setSkipExtensionInstallation(boolean skipExtensionInstallation)
Deprecated.
This method is now a no-op and will be removed in 2.46.0.
|
void |
setUseCleanSession(boolean useCleanSession)
Instruct the SafariDriver to delete all existing session data when starting a new session.
|
com.google.gson.JsonObject |
toJson()
Converts this instance to its JSON representation.
|
public static final java.lang.String CAPABILITY
DesiredCapabilities
object.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 optionspublic void addExtensions(java.io.File... paths)
public void addExtensions(java.util.List<java.io.File> paths)
public void setDataDir(java.io.File dataDir)
public void setDriverExtension(java.io.File driverExtension)
public void setPort(int port)
SafariDriverServer
should be started on. Defaults to 0, in which case
the server selects a free port.port
- The port the SafariDriverServer
should be started on,
or 0 if the server should select a free port.public void setSkipExtensionInstallation(boolean skipExtensionInstallation)
public void 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 com.google.common.base.Optional<java.io.File> getDataDir()
public java.util.List<java.io.File> getExtensions()
public int getPort()
SafariDriverServer
should be started on.
If 0, the server should select a free port.setPort(int)
public boolean getSkipExtensionInstallation()
public boolean getUseCustomDriverExtension()
public boolean getUseCleanSession()
setUseCleanSession(boolean)
public com.google.gson.JsonObject toJson() throws java.io.IOException
java.io.IOException
- If an error occurred while reading the Safari extension files.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object