Created
May 2, 2012 19:38
-
-
Save testingbot/2579632 to your computer and use it in GitHub Desktop.
test with iPhone and Java
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
import junit.framework.TestCase; | |
import org.openqa.selenium.*; | |
import org.openqa.selenium.remote.*; | |
import java.net.URL; | |
import java.util.concurrent.TimeUnit; | |
public class SimpleTest extends TestCase { | |
private WebDriver driver; | |
public void setUp() throws Exception { | |
DesiredCapabilities capabillities = DesiredCapabilities.iphone(); | |
capabillities.setCapability("platform", Platform.MAC); | |
capabillities.setCapability("name", "Testing iPhone"); | |
this.driver = new RemoteWebDriver( | |
new URL("http://key:[email protected]:4444/wd/hub"), | |
capabillities); | |
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); | |
} | |
public void testSimple() throws Exception { | |
this.driver.get("http://www.google.com"); | |
assertEquals("Google", 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