Codota Logo
Proxy.extractFrom
Code IndexAdd Codota to your IDE (free)

How to use
extractFrom
method
in
org.openqa.selenium.Proxy

Best Java code snippets using org.openqa.selenium.Proxy.extractFrom (Showing top 11 results out of 315)

  • Common ways to obtain Proxy
private void myMethod () {
Proxy p =
  • Codota Iconnew Proxy()
  • Codota IconCapabilities capabilities;Proxy.extractFrom(capabilities)
  • Codota IconBrowserMobProxy browserMobProxy;ClientUtil.createSeleniumProxy(browserMobProxy)
  • Smart code suggestions by Codota
}
origin: detro/ghostdriver

proxy = Proxy.extractFrom(desiredCapabilities);
origin: net.serenity-bdd/serenity-core

  public static Proxy extractProxy(Capabilities capabilities) {
    return Proxy.extractFrom(capabilities);
  }
}
origin: vmi/selenese-runner-java

  public static Proxy extractProxy(Capabilities desiredCapabilities) {
    return Proxy.extractFrom(desiredCapabilities);
  }
}
origin: net.serenity-bdd/core

  public static Proxy extractProxy(Capabilities capabilities) {
    return Proxy.extractFrom(capabilities);
  }
}
origin: com.machinepublishers/jbrowserdriver

 Settings build(Capabilities capabilities) {
  Map properties = new HashMap(capabilities.asMap());
  Proxy proxy = Proxy.extractFrom(capabilities);
  if (proxy != null) {
   String proxyConfigString = proxy.getHttpProxy();
   if (proxyConfigString != null) {
    Pattern pattern = Pattern.compile("(?:http(?:s)?:\\/\\/)?(?:([^:@]*):([^:@]*)@)?([^:@]*)(?::(\\d+))?");
    Matcher matcher = pattern.matcher(proxyConfigString);
    if (matcher.matches()) {
     properties.put(PropertyName.PROXY_TYPE.propertyName, ProxyConfig.Type.HTTP);
     properties.put(PropertyName.PROXY_USERNAME.propertyName, matcher.group(1));
     properties.put(PropertyName.PROXY_PASSWORD.propertyName, matcher.group(2));
     properties.put(PropertyName.PROXY_HOST.propertyName, matcher.group(3));
     properties.put(PropertyName.PROXY_PORT.propertyName, matcher.group(4));
    }
   }
  }
  for (Map.Entry entry : System.getProperties().entrySet()) {
   properties.put(entry.getKey(), entry.getValue());
  }
  return new Settings(this, properties);
 }
}
origin: com.github.arachnidium/arachnidium-core

  private void transformCapabilities() {
    // transforms relative path to application into absolute
    Object pathToApp = getCapability(appCapability);
    if (pathToApp != null) {
      File app = new File(String.valueOf(pathToApp));
      builtCapabilities.setCapability(appCapability,
          app.getAbsolutePath());
    }
    //sets proxy
    Proxy proxy = Proxy.extractFrom(builtCapabilities);
    if (proxy!=null){
      builtCapabilities.setCapability(proxyCapability, proxy);
    }
    // if other actions need to be implemented code will be below
  }
}
origin: arachnidium/arachnidium-java

  private void transformCapabilities() {
    // transforms relative path to application into absolute
    Object pathToApp = getCapability(appCapability);
    if (pathToApp != null) {
      File app = new File(String.valueOf(pathToApp));
      builtCapabilities.setCapability(appCapability,
          app.getAbsolutePath());
    }
    //sets proxy
    Proxy proxy = Proxy.extractFrom(builtCapabilities);
    if (proxy!=null){
      builtCapabilities.setCapability(proxyCapability, proxy);
    }
    // if other actions need to be implemented code will be below
  }
}
origin: org.seleniumhq.selenium/selenium-firefox-driver

 /**
  * Drops capabilities that we shouldn't send over the wire.
  *
  * Used for capabilities which aren't BeanToJson-convertable, and are only used by the local
  * launcher.
  */
 private static Capabilities dropCapabilities(Capabilities capabilities) {
  if (capabilities == null) {
   return new ImmutableCapabilities();
  }

  MutableCapabilities caps;

  if (isLegacy(capabilities)) {
   final Set<String> toRemove = Sets.newHashSet(BINARY, PROFILE);
   caps = new MutableCapabilities(
     Maps.filterKeys(capabilities.asMap(), key -> !toRemove.contains(key)));
  } else {
   caps = new MutableCapabilities(capabilities);
  }

  // Ensure that the proxy is in a state fit to be sent to the extension
  Proxy proxy = Proxy.extractFrom(capabilities);
  if (proxy != null) {
   caps.setCapability(PROXY, proxy);
  }

  return caps;
 }
}
origin: org.seleniumhq.selenium/selenium-htmlunit-driver

/**
 * Note: There are two configuration modes for the HtmlUnitDriver using this constructor.
 * <ol>
 *   <li>The first is where the browserName is "chrome", "firefox" or "internet explorer"
 *       and browserVersion denotes the desired version.</li>
 *   <li>The second one is where the browserName is "htmlunit" and the browserVersion
 *       denotes the required browser AND its version. In this mode the browserVersion could be
 *       "chrome" for Chrome, "firefox-38" for Firefox 38 or "internet explorer-11" for IE 11.</li>
 * </ol>
 * <p>The Remote WebDriver uses the second mode - the first mode is deprecated and should not be used.
 *
 * @param capabilities desired capabilities requested for the htmlunit driver session
 */
public HtmlUnitDriver(Capabilities capabilities) {
 this(determineBrowserVersion(capabilities));
 setJavascriptEnabled(capabilities.isJavascriptEnabled());
 setProxySettings(Proxy.extractFrom(capabilities));
}
origin: com.codeborne/phantomjsdriver

proxy = Proxy.extractFrom(desiredCapabilities);
origin: vmi/selenese-runner-java

proxy = Proxy.extractFrom(desiredCapabilities);
org.openqa.seleniumProxyextractFrom

Popular methods of Proxy

  • <init>
  • setHttpProxy
    Specify which proxy to use for HTTP connections.
  • setSslProxy
    Specify which proxy to use for SSL connections.
  • setFtpProxy
    Specify which proxy to use for FTP connections.
  • setProxyType
    Explicitly sets the proxy type, useful for forcing direct connection on Linux.
  • getHttpProxy
    Gets the HTTP proxy.
  • setNoProxy
    Sets proxy bypass (noproxy) addresses
  • getProxyType
    Gets the ProxyType. This can signal if set to use a direct connection (without proxy), manually set
  • setProxyAutoconfigUrl
    Specifies the URL to be used for proxy auto-configuration. Expected format is http://hostname.com:12
  • setSocksProxy
    Specifies which proxy to use for SOCKS.
  • getSocksProxy
    Gets the SOCKS proxy.
  • setAutodetect
    Specifies whether to autodetect proxy settings.
  • getSocksProxy,
  • setAutodetect,
  • getProxyAutoconfigUrl,
  • getSocksPassword,
  • getSocksUsername,
  • getFtpProxy,
  • getNoProxy,
  • setSocksPassword,
  • setSocksUsername

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now