Introduction
We want to execute our test scripts on a iphone device. The iphone driver allows us to execute the WebDriver tests on a real iphone device.
Configuration
We need to install Xcode which is available for the Mac operating systems. We also need a provisoning profile for running the script on a real device.
1) We need to create a provisioning profile, so go to this website and create a profile.
2) We need to download Xcode from the following location: this
3) The iPhone WebDriver application is not available from the App Store, therefore we need to check-out the code and build it manually. We can do the check-out by entering the following terminal command:
1
|
|
Solution
1) Open the project selenium-read-only/iphone/iWebDriver.xcodeproj in Xcode.
2) Double-click on the project and set the build configuration to the latest version of the iPhone Simulator, by using the drop-down box in the top left corner.
3) Configure and install the iPhone provisioning profile.
4) Open Info.plist and edit the Bundle Identifier to com.NAME.$ {PRODUCT_NAME:identifier} where NAME is the name you registered your provisioning profile to be an authority on.
5) Make sure your device is connected to your computer. Your device must also be routable from your computer. The easiest way to do this is to configure a wifi network and connect your device to it.
6) Click on Run (play button). After compiling, the iphone simulator should appear and the iWebDriver app will be installed in it.
7) Now we can use the IPhoneDriver in our tests. You will need to take a look in TestNG Framework. Create new TestNG class and paste the code below :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
8) Run your script.
Post a Comment
Post a Comment