Running tests on iOS using the iWebDriver App and iPhone driver
Once we have the iOS simulator or the device set up with the iWebDriver application, you can create and run the tests using the IPhoneDriver
class.
In this recipe, we will test a simple mobile BMI calculator web application, developed using jQuery Mobile on the iOS platform.
Getting ready
Before we start running the test with the iPhone driver, set up the iOS simulator or device with the iWebDriver application.
If you are testing on a real device, then make sure it is connected to the machine running the tests using the iPhone driver over the network.
Set up the iOS simulator or a real device with the iWebDriver application
Set up a new Java project
Add the WebDriver JARs to the project's build-path
Add the JUnit library to the project
How to do it...
Execute the following test with iWebDriver:
Create a new JUnit test named
IPhoneDriverTest
.Copy the following code to the newly created
IPhoneDriverTest
class:import org.openqa.selenium.WebDriver...