appium(2)-Setting up Appium
Setting up Appium
Running Appium on Windows
Additional Setup for Android App Testing
- Download latest node and npm tools MSI (version >= 6.0). The
npm
andnodejs
paths should be in your PATH environment variable. - Download the latest Java JDK here (accept the license agreement first). Set 'JAVA_HOME’ to be your JDK path. The
bin
in that directory should be added to your PATH variable. - Install the Android SDK. Set the
ANDROID_HOME
environment variable to be your Android SDK path and add thetools
andplatform-tools
folders to your PATH variable. - Install Apache Ant or use the one that comes with the Android Windows SDK in the eclipse\plugins folder. Be sure to add the folder containing Ant to your PATH variable.//可省略,从源码安装appium时才需要
- Install Apache Maven and set the M2HOME and M2 environment variables. Set
M2_HOME
to the directory maven is installed in, and setM2
to thebin
in that directory. Add the path you used forM2
to your PATH.//可省略 - To run tests on Windows, you will need to have the Android Emulator booted or an Android Device connected that is running an AVD with API Level 17 or greater. Then run Appium on the command line (via the
appium
command) - Your test script should ensure that the
platformVersion
capability corresponds to the emulator or device version you are testing, and that theapp
capability is an absolute path to the .apk file of the Android app.
Setup
You can run an Appium server using node.js or using the application, see below.
-
Using Node.js
- npm install -g appium
- appium
- Using the App
- Download the Appium
- Run it!
Running Appium on Mac OS X
Appium on OS X supports iOS and Android testing.
System setup (iOS)
- Appium requires Mac OS X 10.7 or greater. We recommend OS X 10.10.
- Make sure you have Xcode and the iOS SDK(s) installed. Xcode version 7.1 is recommended as earlier versions of Xcode are limited in which versions of iOS they can test against. See the next section for more detail.
- You need to authorize use of the iOS Simulator. See below.
- If you’re on Xcode 7.x, Instruments Without Delay (IWD) does not work. You can enable IWD (which will significantly speed up your tests) using this method
You need to authorize use of the iOS Simulator by running the authorize-ios
binary made available through npm
. Install the program by running
npm install -g authorize-ios
And the invoke the program using
sudo authorize-ios
If you are running Appium.app, you can authorize iOS through the GUI.
You need to do this every time you install a new version of Xcode.