Created
March 5, 2012 21:48
-
-
Save santiycr/1981343 to your computer and use it in GitHub Desktop.
Repro on slow Selenium proxy for HTTPS pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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