Example usage for org.openqa.selenium Proxy setProxyType

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

Introduction

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

Prototype

public Proxy setProxyType(ProxyType proxyType) 

Source Link

Document

Explicitly sets the proxy type, useful for forcing direct connection on Linux.

Usage

From source file:com.elastica.driver.DriverConfig.java

License:Apache License

public Proxy getProxy() {
    Proxy proxy = null;
    if (proxyHost != null) {
        proxy = new Proxy();
        proxy.setProxyType(ProxyType.MANUAL);
        proxy.setHttpProxy(proxyHost);//  w ww.  ja  v  a 2s.com
        proxy.setFtpProxy(proxyHost);
        proxy.setSslProxy(proxyHost);
    }

    return proxy;

}

From source file:com.groupon.odo.bmp.ProxyServer.java

License:Apache License

public org.openqa.selenium.Proxy seleniumProxy() throws UnknownHostException {
    Proxy proxy = new Proxy();
    proxy.setProxyType(Proxy.ProxyType.MANUAL);
    String proxyStr = String.format("%s:%d", getLocalHost().getCanonicalHostName(), getPort());
    proxy.setHttpProxy(proxyStr);// w w w .j  a  va 2s  .c  o m
    proxy.setSslProxy(proxyStr);

    return proxy;
}

From source file:ike.Ike.java

public static void main(String[] args) throws InterruptedException, FileNotFoundException, IOException {
    setProps();/*from  w  w  w  .ja  va  2  s.  c  om*/
    FirefoxOptions options = new FirefoxOptions().setProfile(new FirefoxProfile());
    Proxy proxy = new Proxy();
    proxy.setProxyType(Proxy.ProxyType.AUTODETECT);
    DesiredCapabilities capabilities = DesiredCapabilities.firefox();
    capabilities.setCapability("proxy", proxy);
    WebDriver driver = new FirefoxDriver(capabilities);
    driver.get("https://sise2mx.ikeasistencia.com/");
    driver.findElement(By.id("Usr")).clear();
    driver.findElement(By.id("Usr")).sendKeys("cmantenimiento");
    driver.findElement(By.id("Pass")).clear();
    driver.findElement(By.id("Pass")).sendKeys(readPass());
    driver.findElement(By.id("btnLogin")).click();
    for (int i = 0; i < 1; i = 0) {
        Thread.sleep(3100);
        if ((isElementPresent(("//*[@id=\"PW_LST\"]/tbody/tr[3]/td[10]/button"), driver)) == true) {
            driver.findElement(By.xpath("//*[@id=\"PW_LST\"]/tbody/tr[3]/td[10]/button")).click();
            System.out.println("Has aceptado un nuevo expediente.");
            System.out.println("Fecha: " + timeStamp());
            //msg();
        }
        if ((isElementPresent(("//*[@id=\"msg_alerta\"]/table/tbody/tr/td/table/tbody/tr[4]/td/button"),
                driver)) == true) {
            driver.findElement(
                    By.xpath("//*[@id=\"msg_alerta\"]/table/tbody/tr/td/table/tbody/tr[4]/td/button")).click();
            if ((isElementPresent(("//*[@id=\"PW_LST\"]/tbody/tr[3]/td[10]/button"), driver)) == true) {
                driver.findElement(By.xpath("//*[@id=\"PW_LST\"]/tbody/tr[3]/td[10]/button")).click();
            }
            System.out.println("Has aceptado un nuevo expediente.");
            System.out.println("Fecha: " + timeStamp());
            //msg();
        }
        if ((isElementPresent(("//*[@id=\"MensajeTimeOut\"]/table"), driver)) == true) {
            driver.findElement(
                    By.xpath("//*[@id=\"MensajeTimeOut\"]/table/tbody/tr/td/table/tbody/tr[4]/td[2]/button"))
                    .click();
        } else {
            driver.findElement(By.xpath("//div[2]/div[2]/table/tbody/tr/td")).click();
        }
    }
}

From source file:io.kahu.hawaii.cucumber.glue.html.HtmlSteps.java

License:Apache License

private Proxy getHttpProxy() {
    Proxy proxy = null;
    String proxyHost = System.getProperty(PROXY_HOST_KEY);
    String proxyPort = System.getProperty(PROXY_PORT_KEY);
    if (proxyHost != null && proxyPort != null) {
        proxy = new Proxy();
        proxy.setHttpProxy(proxyHost + ":" + proxyPort);
        proxy.setProxyType(Proxy.ProxyType.MANUAL);
        proxy.setSslProxy(proxyHost + ":" + proxyPort);
    }//from   w w  w .j  a v a2  s.  co  m
    return proxy;
}

From source file:net.continuumsecurity.web.drivers.BurpFirefoxDriver.java

License:Open Source License

public Proxy getBurpProxy() {
    Proxy proxy = new Proxy();
    proxy.setProxyType(Proxy.ProxyType.MANUAL);
    String proxyStr = String.format("%s:%d", Config.getBurpHost(), Config.getBurpPort());
    proxy.setHttpProxy(proxyStr);// w w w  . ja  v  a2  s.c o m
    proxy.setSslProxy(proxyStr);

    return proxy;
}