Skip to content

Instantly share code, notes, and snippets.

@santiycr
Created March 5, 2012 21:48
Show Gist options
  • Select an option

  • Save santiycr/1981343 to your computer and use it in GitHub Desktop.

Select an option

Save santiycr/1981343 to your computer and use it in GitHub Desktop.
Repro on slow Selenium proxy for HTTPS pages
package tests;
import junit.framework.TestCase;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.*;
import org.openqa.selenium.remote.*;
import java.util.concurrent.TimeUnit;
public class ProxyTest extends TestCase {
private WebDriver driver;
public void setUp() throws Exception {
String PROXY = "localhost:4444";
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY)
.setFtpProxy(PROXY)
.setSslProxy(PROXY);
DesiredCapabilities cap = DesiredCapabilities.firefox();
cap.setCapability(CapabilityType.PROXY, proxy);
this.driver = new FirefoxDriver(cap);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
public void proxyTest() throws Exception {
this.driver.get("https://saucelabs.com/test/guinea-pig");
assertEquals("I am a page title - Sauce Labs",
this.driver.getTitle());
}
public void tearDown() throws Exception {
this.driver.quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment