Package org.openqa.selenium

Examples of org.openqa.selenium.Proxy


    assertTrue(proxy.isEnabled());
  }

  @Test
  public void parseAutomaticProxies() {
    Proxy p = new Proxy().setProxyAutoconfigUrl(url);
    proxy.parse(p);

    assertTrue(proxy.isUsePAC());
    assertTrue(proxy.isEnabled());
  }
View Full Code Here


  }

  @Test
  @Ignore(products = MOBILE)
  public void parseDirectProxyConnection() {
    Proxy p = new Proxy().setProxyType(ProxyType.DIRECT);
    proxy.parse(p);

    assertFalse(proxy.isEnabled());
    assertFalse(proxy.isUsePAC());
  }
View Full Code Here

    assertTrue((Boolean) AUTOSTART.sanitize("true"));
  }

  @Test
  public void proxySanitizeProxyObject() {
    Proxy proxy = new Proxy();
    proxy.setHttpProxy("4.4.4.4");

    Proxy sanitizedProxy = (Proxy) PROXY.sanitize(proxy);
    assertNotNull(sanitizedProxy);
    assertThat(sanitizedProxy, is(instanceOf(Proxy.class)));
    assertEquals(proxy, sanitizedProxy);
    assertEquals("4.4.4.4", sanitizedProxy.getHttpProxy());
  }
View Full Code Here

  @Test
  public void proxySanitizeMap() {
    Map<String, ?> jsonProxy = ImmutableMap.of("httpProxy", "4.4.4.4");

    Proxy sanitizedProxy = (Proxy) PROXY.sanitize(jsonProxy);
    assertNotNull(sanitizedProxy);
    assertThat(sanitizedProxy, is(instanceOf(Proxy.class)));
    assertEquals("4.4.4.4", sanitizedProxy.getHttpProxy());
  }
View Full Code Here

    assertThat(settings.getProxy(), is(instanceOf(Proxy.class)));
  }

  @Test
  public void proxyCanBeSet() {
    Proxy proxy = new Proxy();
    proxy.setHttpProxy("4.4.4.4");

    settings.setProxy(proxy);
    assertEquals(proxy, settings.getProxy());
    assertEquals("4.4.4.4", settings.getProxy().getHttpProxy());
  }
View Full Code Here

        server.start();
    }

    public org.openqa.selenium.Proxy seleniumProxy() {
        Proxy proxy = new Proxy();
        proxy.setProxyType(Proxy.ProxyType.MANUAL);
        String proxyStr = String.format("localhost:%d", getPort());
        proxy.setHttpProxy(proxyStr);
        proxy.setSslProxy(proxyStr);

        return proxy;
    }
View Full Code Here

     * @param desiredCapabilities DesiredCapabilities object.
     * @return PhantomJSDriverService object.
     */
    public static PhantomJSDriverService createDefaultService(Capabilities desiredCapabilities) {
        // Look for Proxy configuration within the Capabilities
        Proxy proxy = null;
        if (desiredCapabilities != null) {
            proxy = Proxies.extractProxy(desiredCapabilities);
        }

        // Find PhantomJS executable
View Full Code Here

     *
     * @return A new ChromeDriverService using the default configuration.
     */
    public static PhantomJSDriverService createDefaultService(Capabilities desiredCapabilities) {
        // Look for Proxy configuration within the Capabilities
        Proxy proxy = null;
        if (desiredCapabilities != null) {
            proxy = Proxy.extractFrom(desiredCapabilities);
        }

        // Find PhantomJS executable
View Full Code Here

            if (!isProxySupported()) {
                log.warn("No support proxy with {}. Please set proxy to browser configuration in advance.",
                    getClass().getSimpleName().replaceFirst("Factory$", ""));
                return caps;
            }
            Proxy proxy = new Proxy();
            proxy.setProxyType(ProxyType.MANUAL);
            String ps = driverOptions.get(PROXY);
            proxy.setHttpProxy(ps)
                .setSslProxy(ps)
                .setFtpProxy(ps);
            if (driverOptions.has(NO_PROXY))
                proxy.setNoProxy(driverOptions.get(NO_PROXY));
            caps.setCapability(CapabilityType.PROXY, proxy);
        }
        return caps;
    }
View Full Code Here

        setPort(listener.getPort());
    }

    public org.openqa.selenium.Proxy seleniumProxy() throws UnknownHostException {
        Proxy proxy = new Proxy();
        proxy.setProxyType(Proxy.ProxyType.MANUAL);
        String proxyStr = String.format("%s:%d", InetAddress.getLocalHost().getCanonicalHostName(),  getPort());
        proxy.setHttpProxy(proxyStr);
        proxy.setSslProxy(proxyStr);

        return proxy;
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.Proxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.