Example usage for org.openqa.selenium Proxy Proxy

List of usage examples for org.openqa.selenium Proxy Proxy

Introduction

In this page you can find the example usage for org.openqa.selenium Proxy Proxy.

Prototype

public Proxy(Map<String, ?> raw) 

Source Link

Usage

From source file:com.mgmtp.jfunk.web.CapabilitiesProvider.java

License:Apache License

private Proxy createProxyFromConfig(final Configuration config) {
    Map<String, String> proxyConfig = newHashMap();

    for (Entry<String, String> entry : config.entrySet()) {
        String key = entry.getKey();
        if (key.startsWith(PROXY_PREFIX)) {
            proxyConfig.put(substringAfter(key, PROXY_PREFIX), entry.getValue());
        }/*  w  ww .  j a va 2 s.com*/
    }

    if (proxyConfig.isEmpty()) {
        return null;
    }
    return new Proxy(proxyConfig);
}

From source file:minium.web.config.services.PhantomJsDriverServiceProperties.java

License:Apache License

@Override
public DriverService createDriverService() {
    Builder builder = new PhantomJSDriverService.Builder();

    if (driverExecutable != null)
        builder.usingPhantomJSExecutable(driverExecutable);
    if (ghostDriver != null)
        builder.usingGhostDriver(ghostDriver);
    if (port != null)
        builder.usingPort(port);/*w  ww .  j a  v a2  s.c  om*/
    if (environment != null)
        builder.withEnvironment(environment);
    if (logFile != null)
        builder.withLogFile(logFile);
    if (proxy != null)
        builder.withProxy(new Proxy(proxy));
    if (commandLineArguments != null)
        builder.usingCommandLineArguments(commandLineArguments);
    if (ghostDriverCommandLineArguments != null)
        builder.usingGhostDriverCommandLineArguments(ghostDriverCommandLineArguments);

    return builder.build();
}