Appium is an open source test automation tool to automate native and hybrid mobile apps. For more details about the tool please go through http://appium.io/
Below are the steps for setting up Appium in your test machine (with Eclipse):
Step-1: Install Java
Ensure you have java installed in your machine. If not installed, please install it as per the below steps.
Step-3: Install Appium
Below are the steps for setting up Appium in your test machine (with Eclipse):
Step-1: Install Java
Ensure you have java installed in your machine. If not installed, please install it as per the below steps.
- Download latest java from http://www.oracle.com/technetwork/java/javase/downloads/index.html or from http://java.com/en/download/
- Double click on the downloaded file and follow the instructions to finish the installation. Please note the installation directory.
- Once java is installed, you need to set the path for java as follows
- Please refer the "Java PATH setting" section of link http://knowledgebase-wiki.appspot.com/docs/Installing_Java.html
- Look for ".bash_profile" in your home folder
- If hidden files are not shown by default, you won't see this file. So execute below 2 command to show hidden files in mac
- Start up Terminal
- Type "cd ~/" to go to your home folder
- Type "touch .bash_profile" to create your new file if ".bash_profile" doesn't exist
- Edit ".bash_profile" with your favorite editor (or you can just type "open -e .bash_profile" to open it in TextEdit.
- Update the file with the installed java home location as below example format
- To test java installation, open your command prompt(in windows) or terminal(in mac) and enter
- You will get the version of java you have installed as below example,
defaults write com.apple.finder AppleShowAllFiles YES killall Finder
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
export PATH=$PATH:${JAVA_HOME}:${JAVA_HOME}/bin
java -version
java version "1.8.0_71" Java(TM) SE Runtime Environment (build 1.8.0_71-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
Step-2: Download ADT bundle for Eclipse(Only if you want to test android application, not required for iOS application testing)
- You can download adt bundles (e.g. version 2014-07-02) from below sites:
- Extract the downloaded zip file and extract them to a safe folder. Inside the folder you will find 2 folders. One is eclipse and another with SDK for android
- Set the PATH for android SDK.
- In Windows, create a system variable ANDROID_HOME and append the "tools" and "platform-tools" locations in PATH environment variable
- In Mac, append the below in ".bash_profile" file
- Then you need to test sdk installation in the system. To do this, navigate to "platform-tools" directory inside sdk from command line or terminal and type command
- You should get the below message in the terminal or command prompt
- If you won't see "List of devices attached" message in the output, you might not set the sdk path properly. Please check the steps once again and correct the missing ones to get it properly.
- If you want latest android versions, open SDK manager and update the required android versions.
windows 32: https://dl.google.com/android/adt/adt-bundle-windows-x86-20140702.zip
windows 64: https://dl.google.com/android/adt/adt-bundle-windows-x86_64-20140702.zip
Mac 64: https://dl.google.com/android/adt/adt-bundle-mac-x86_64-20140702.zip
Linux 86: https://dl.google.com/android/adt/adt-bundle-linux-x86-20140702.zip
Linux 64: https://dl.google.com/android/adt/adt-bundle-linux-x86_64-20140702.zip
PATH=%ANDROID_HOME%//tools;%ANDROID_HOME%//platform-tools;
set ANDROID_HOME=/Applications/adt-bundle-mac-x86_64-20140702/sdk
export ANDROID_HOME=/Applications/adt-bundle-mac-x86_64-20140702/sdk
export PATH=$PATH:${JAVA_HOME}:${JAVA_HOME}/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
adb devices
* daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached
- Open terminal and type below command
- Click the enter key and enter system password if it asks
- Note: Sometimes in Mac system, you may get command not found error. Then please ensure the below is added in your ".bash_profile". You can addend at the end of file.
- Next type the below command
- Then click enter and follow the instructions to continue (provide system password is prompts)
- Note: In mac machine, it may prompt for any dependant software (e.g. xcode) then please click on install, if you want to test an iOS application. If you want to test an android application you don't need to install it.
- Next install node by below command
- and click enter. It downloads some files and installs them
- To see node is installed successfully, please type below in command line
- and click enter then you can see the version of the node installed
- Install appium by executing below command
- and click enter, it will take some time to download all the appium related installations.
- To test appium installation, use below command
- and click enter, it will show the version of appium running and will start the appium server from command line.
sudo chown -R `whoami` /usr/local
export PATH=$PATH:/usr/sbin
export PATH=$PATH:/usr/bin
export PATH=$PATH:/usr/local/bin
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install node
node -v
npm install -g appium
appium
info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) info: Appium REST http interface listener started on 0.0.0.0:4723 info: Console LogLevel: debug
Now you can proceed with developing/executing android or iOS automated tests using appium.
Happy testing!!!
Happy testing!!!