Appium is used to execute same automated tests on multiple devices with different platform. Appium supports android, IOS, windows. Here we will talk about how to run test on Real IOS device for web App using Appium.
- Mac OS X 10.7 (minimum version required)
- You need to enroll for iOS Developer program with a valid Apple id account.
- Download and Install Xcode updated version (prefer)
- An iOS Device connected and recognized by your machine.
- Set up & install Eclipse on Mac– Refer the article “Appium-Eclipse On Mac”
- Download Latest Selenium Jars for java from the Selenium website
- Download the java client libraries from http://appium.io/downloads.html
- Create a provisioning profile for the launcher – Refer the article “Appium-Provisioning Profile & AppID”
- Download and Set up Appium latest version on Mac – Refer the article “Appium-Install Appium on Mac”
Appium Test on Real IOS Device
1) Find UDID (Unique Device Identifier) of IOS Device:
- a) Connect your IOS Device to Mac & Launch iTunes.
- b) In the left pane, go to Devices-> Select your Device. In the right pane, all the information related to IOS Device will be displayed.
- c) Reveal the Identifier by clicking on Serial Number.
- d) Copy the identifier to your clipboard by choosing Edit->Copy & Save it for later use.
2) Turn on Web Inspector on IOS Device. Go to Settings -> Safari -> Advanced -> Web inspector
3) Install brew (The missing package manager for OS X)
4) Type command in Terminal prompt. (You can open terminal by Finder. Open Finder (Finder is available in the Dock.) Select Applications. Then chose Utilities. Double click on Terminal. ) Now type below command:
“/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
5) Install ios_webkit_debug_proxy. For accessing web views on real iOS device Appium uses this. To install the latest tagged version of the ios-webkit-debug-proxy using Homebrew, run the following commands in the terminal prompt in given sequence:
- a. brew update
- b. brew install ios-webkit-debug-proxy
6) ios_webkit_debug_proxy should be running and listening on port 27753. So after installing you can start the proxy with the following command in terminal:
- a. ios_webkit_debug_proxy -c <Connected device UDID>:27753 –d
7) To be able to run your tests against mobile Safari we use the SafariLauncher App to launch Safari. Once Safari has been launched the Remote Debugger automatically connects using the ios-webkit-debug-proxy. Here you should have a provisioning profile that can be used to deploy the SafariLauncherApp.
Make sure you use Xcode to install safari launcher app on your device. To do this first download Git project from https://github.com/budhash/SafariLauncher link.
- a. Open this project using Xcode. Build and run the Project. This will create an app file that will be used to set App Path for Appium. Refer the article: “Appium-Run Xcode Project”)
- b. Make sure you have a new terminal and run:
- i. ios_webkit_debug_proxy -c <Device UDID> –d
- c. Open another terminal and Type command to start the Appium server & install safari:
- i. cd Appium
- ii. node -U –app <safari app path>
8) Now open Appium Application & click on Appium Doctor shown below. It will open a terminal & will check whether all required set up is done to start automation.
You are good to start writing your selenium web driver scripts now. Add Selenium jars to eclipse & start Automating. Here is the desired capabilities: