Introduction
We want to run our test in a iPhone simulator. The iphone simulator comes with Xcode which is available for the Mac operating systems. This recipe will show us how we can run our WebDriver tests in a iphone simulator.
We need to download Xcode from the following location: here
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 2 |
|
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) Click on Run (play button). After compiling, the iphone simulator should appear and the iWebDriver app will be installed in it.
4) 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 |
|
5) Run your test.
Post a Comment
Post a Comment