public class EdgeOptions
extends org.openqa.selenium.MutableCapabilities
EdgeDriver.
Example usage:
EdgeOptions options = new EdgeOptions()
options.addExtensions(new File("/path/to/extension.crx"))
options.setBinary(new File("/path/to/msedge"));
// For use with EdgeDriver:
EdgeDriver driver = new EdgeDriver(options);
// For use with RemoteWebDriver:
RemoteWebDriver driver = new RemoteWebDriver(
new URL("http://localhost:4444/wd/hub"),
new EdgeOptions());
| Modifier and Type | Field and Description |
|---|---|
static String |
CAPABILITY
Key used to store a set of EdgeOptions in a
Capabilities
object. |
static String |
USE_CHROMIUM |
| Constructor and Description |
|---|
EdgeOptions() |
| Modifier and Type | Method and Description |
|---|---|
EdgeOptions |
addArguments(List<String> arguments)
Adds additional command line arguments to be used when starting Edge.
|
EdgeOptions |
addArguments(String... arguments) |
EdgeOptions |
addEncodedExtensions(List<String> encoded)
Adds a new Edge extension to install on browser startup.
|
EdgeOptions |
addEncodedExtensions(String... encoded) |
EdgeOptions |
addExtensions(File... paths) |
EdgeOptions |
addExtensions(List<File> paths)
Adds a new Edge extension to install on browser startup.
|
protected int |
amendHashCode() |
Map<String,Object> |
asMap() |
Object |
getExperimentalOption(String name)
Deprecated.
Getters are not needed in browser Options classes.
|
EdgeOptions |
merge(org.openqa.selenium.Capabilities extraCapabilities) |
EdgeOptions |
setAcceptInsecureCerts(boolean acceptInsecureCerts)
Returns EdgeOptions with the capability ACCEPT_INSECURE_CERTS set.
|
EdgeOptions |
setBinary(File path)
Sets the path to the Edge executable.
|
EdgeOptions |
setBinary(String path)
Sets the path to the Edge executable.
|
EdgeOptions |
setExperimentalOption(String name,
Object value)
Sets an experimental option.
|
EdgeOptions |
setHeadless(boolean headless) |
EdgeOptions |
setPageLoadStrategy(org.openqa.selenium.PageLoadStrategy strategy) |
EdgeOptions |
setProxy(org.openqa.selenium.Proxy proxy) |
EdgeOptions |
setUnhandledPromptBehaviour(org.openqa.selenium.UnexpectedAlertBehaviour behaviour) |
EdgeOptions |
setUseWebView(boolean useWebView)
Sets whether to launch an Edge (Chromium) WebView executable instead of
launching the Edge browser.
|
setCapability, setCapability, setCapability, setCapabilitypublic static final String CAPABILITY
Capabilities
object.public static final String USE_CHROMIUM
public EdgeOptions merge(org.openqa.selenium.Capabilities extraCapabilities)
merge in interface org.openqa.selenium.Capabilitiesmerge in class org.openqa.selenium.MutableCapabilitiespublic EdgeOptions setUseWebView(boolean useWebView)
useWebView - Whether to launch a WebView executable.public EdgeOptions setBinary(File path)
path - Path to Edge executable.public EdgeOptions setBinary(String path)
path - Path to Edge executable.public EdgeOptions addArguments(String... arguments)
arguments - The arguments to use when starting Edge.addArguments(java.util.List)public EdgeOptions addArguments(List<String> arguments)
options.setArguments(
"load-extension=/path/to/unpacked_extension",
"allow-outdated-plugins");
Each argument may contain an option "--" prefix: "--foo" or "foo". Arguments with an associated value should be delimitted with an "=": "foo=bar".
arguments - The arguments to use when starting Edge.public EdgeOptions addExtensions(File... paths)
paths - Paths to the extensions to install.addExtensions(java.util.List)public EdgeOptions addExtensions(List<File> paths)
paths - Paths to the extensions to install.public EdgeOptions addEncodedExtensions(String... encoded)
encoded - Base64 encoded data of the extensions to install.addEncodedExtensions(java.util.List)public EdgeOptions addEncodedExtensions(List<String> encoded)
encoded - Base64 encoded data of the extensions to install.public EdgeOptions setExperimentalOption(String name, Object value)
EdgeOptions API.name - Name of the experimental option.value - Value of the experimental option, which must be convertible
to JSON.@Deprecated public Object getExperimentalOption(String name)
name - The option name.null if not set.public EdgeOptions setPageLoadStrategy(org.openqa.selenium.PageLoadStrategy strategy)
public EdgeOptions setUnhandledPromptBehaviour(org.openqa.selenium.UnexpectedAlertBehaviour behaviour)
public EdgeOptions setAcceptInsecureCerts(boolean acceptInsecureCerts)
acceptInsecureCerts - public EdgeOptions setHeadless(boolean headless)
public EdgeOptions setProxy(org.openqa.selenium.Proxy proxy)
protected int amendHashCode()
Copyright © 2022. All rights reserved.