Java Code Examples for org.openqa.selenium.remote.DesiredCapabilities.getCapability()

The following are Jave code examples for showing how to use getCapability() of the org.openqa.selenium.remote.DesiredCapabilities class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: devtools-driver   File:   Source Code and License Vote up 6 votes
public final SafariBrowser launch(DesiredCapabilities caps) throws BrowserException {
  String udid = (String) caps.getCapability("uuid");
  SafariBrowser browser = udid == null ? launch() : launch(udid);
  Map<String, String> proxyDict = (Map<String, String>) caps.getCapability("proxy");
  if (proxyDict != null) {
    HostAndPort proxy = HostAndPort.fromString(proxyDict.get("httpProxy"));
  Map<String, String> cert = (Map<String, String>) caps.getCapability("httpsCert");
  if (cert != null) {
    browser.installHttpsCert(cert.get("certName"), cert.get("certContentBase64"));
  return browser;
Example 2
Project: Cognizant-Intelligent-Test-Scripter   File:   Source Code and License Vote up 5 votes
 * @param caps
 * @return
private static DesiredCapabilities withHeadlessChrome(DesiredCapabilities caps) {
    ChromeOptions options = (ChromeOptions) caps.getCapability(ChromeOptions.CAPABILITY);
    options.addArguments("--headless", "--disable-gpu", "--window-size=1366,768");
    caps.setCapability(ChromeOptions.CAPABILITY, options);
    return caps;