O'Reilly logo

Selenium 2 Testing Tools Beginner's Guide by David Burns

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – using the iPhone driver

In this section, we are going to be looking at running some tests against an iOS device or simulator. This should be a fairly simple change to our test but there are a couple of things that we need to do right before the test runs.

  1. Now we are ready to update our test. I will show an example from the previous test:
    import junit.framework.TestCase; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.iphone.IphoneDriver; public class TestChapter7 { WebDriver driver; @Before public void setUp(){ driver = new IPhoneDriver(); driver.get("http://book.theautomatedtester.co.uk/chapter4"); } @After public void tearDown(){ driver.quit(); } @Test public void testExamples(){ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required