Appium is a test automation tool for use with native and hybrid iOS applications. It uses the webdriver JSON wire protocol to drive Apple's UIAutomation. Appium is based on Dan Cuellar's work on iOS Auto.
Appium uses the Bottle micro web-framework, and has the goal of working with all off the shelf Selenium client libraries.
There are two big benefits to testing with Appium:
1: Appium uses Apple's UIAutomation library under the hood to perform the automation, which means you do not have to recompile your app or modify in any way to be able to test automate it.
2: With Appium, you are able to write your test in your choice of programming language, using the Selenium WebDriver API and language-specific client libraries. If you only used UIAutomation, you would be required to write tests in JavaScript, and only run the tests through the Instruments application. With Appium, you can test your native iOS app with any language, and with your preferred dev tools.
To get started, clone the repo:
git clone git://github.com/hugs/appium
Next, change into the 'appium' directory, and install dependencies:
pip install -r requirements.txt
To avoid a security dialog that can appear when launching your iOS app, you need to modify your /etc/authorization file. You can do this by settings the element following <allow-root> under <key>system.privilege.taskport</key> to <true/> or by running the supplied python script (at your own risk)
sudo python authorize.py
To launch an interpreter for sending raw UIAutomation javascript commands run:
For the Simulator:
python appium.py "path_to_your_ios_.app"
For a Device:
python appium.py com.yourApps.BundleID -U <DEVICE_UDID>
To launch a webdriver-compatible server, run:
For the Simulator:
python server.py "path_to_your_ios_.app"
For a Device:
python server.py com.yourApps.BundleID -U <DEVICE_UDID>
Tests can be written using raw javascript or webdriver.
An example of the raw javascript approach lives in sample-code/js-test.py
To run the test you must build the sample app (sample-code/apps/TestApp/TestApp.xcodeproj
) in Xcode.
You can find the compiled app using spotlight from the command line. mdfind -name TestApp.app
Use that path to run the sample test python js-test.py "/path/to/sample.app"
An example of the webdriver approach lives in sample-code/webdriver-test.py
Compile and find the app as you did in the previous example and then launch the webdriver server. python server.py "/path/to/sample.app"
Now you can run a test against that server. python webdriver-test.py
Using with a Bitbeambot
- Connect the bitbeambot and place a connected iPad beneath it
- Build and install the calibration app in appium/robot/RobotCalibration/RobotCalibration/xcodeproj to the iPad
- Run the calibration script
python appium/robot/bitbeambot-d2/calibrate.py UDID /dev/tty.robot_usb_handle
- Launch a webdriver server with the -b an d-c flags set
python server.py -u UDID -b /dev/tty.robot_usb_handle -c /path/to/appium/robot/bitbeambot-d2/calibration.pickle Your.Bundle.Identifier
- Now Appium will send tap actions to the bitbeambot instead of through UIAutomation
Fork the project, make a change, and send a pull request!