Home Appium Environment Setup Android Emulators iOS Simulators Appium Architecture Android chrome app automation Safari browser automation Appium Capabilities Inspecting android apps Native Android app automation Inspecting iOS app Native iOS app Automation Real Android Phone automation Real iPhone automation Element Identification Pressing button FaceId and TouchId Fingerprint automation Drag and Drop Tap and press Swipe gestures Hybrid app automation Execute script Synchronization in Appium Screenshots Page Object Models Cucumber and Appium Appium integration with azure Appium and Selenium Grid Running tests in browserstack Parallel testing Recording tests Mobile automation framework Errors and Exceptions in Appium Mobile automation test strategy Mobile automation challenges Appium QnA
Environment setup in appium
In this section, we will see how to install Appium on Mac (High Sierra 10.13.6) and what are the prerequisites. Before you install appium, you need to install bunch of tools as mentioned below.- Install Homebrew - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install IntelliJ IDEA app
- Download and install jdk dmg from oracle site or use command brew cask install java
- Download and install maven - brew install maven
- Install NVM - brew install NVM Once NVM is installed, NVM ls command can be used to see all Node versions. NVM use command can be used to use specific node version
- Install node using NVM - NVM install 10.5
- Install appium - You can install appium in 2 ways - GUI or command line. To download app, head to http://appium.io/downloads.html. To install appium via command line, execute command npm install -g appium
- android studio or Android SDK command line tools
- npm install -g appium-doctor
- Set variables in .bash_profile file. See below for what variables needs to be set
Bash profile file for Appium environment
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
export ANDROID_HOME=/Users/admin/Library/Android/sdk
export PATH=${PATH}:/User/admin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
export PATH=${PATH}:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:/usr/local/bin/mvn
Appium environment for iOS App automation
- brew install carthage
- Install Xcode - Download app file and keep it in applications directory
- Install Xcode command line tools (git, gcc, c++) - xcode-select --install
JDK Installation
usr/bin/java is where java will be installed by brew. usr/local/bin/mvn is where maven is installed. Actual location of Java is /library/java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home. But it may change depending upon what version of Java you are installing.
#Export variable
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
If you want to add any path to PATH variable, you can use below command.
#Update PATH variable
export PATH=/opt/apache-maven-3.6.0/bin:$PATH
If you want to see value of any variable, you can use below command.
#Print variable
Echo $JAVA_HOME
For installing different Java versions using cask, use below commands
#Using cask
brew tap homebrew/cask-versions
brew search java
brew cask install java7
brew cask install java6
Some useful commands are here.
#View all installed Java versions
/usr/libexec/java_home -V
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
java -version
npm install -g appium-doctor
appium-doctor
If any tool is missing, appium doctor will tell exactly which tools are not installed.Node and Appium version compatibility
It is important that versions of Node and Appium are compatible. If node version is not compatible, appium will not work properly. e.g. When I upgraded the Node version to 10.5, appium started working without any issues. You can use NVM to manage Node version.Web development and Automation testing
solutions delivered!!