I will be updating all my Appium Related Work in this Repository
Appium is an open source test automation tool developed and supported by Sauce Labs to automate native and hybrid mobile apps. It is basically know as a Cross-Platform Mobile Automation Tool. It uses JSON wire protocol internally to interact with iOS and Android native apps using the Selenium WebDriver.
Appium is a HTTP server written in node.js which creates and handles multiple WebDriver sessions for different platforms like iOS and Android. Appium starts a “test case” on the device that spawns a server and listens for proxies commands from the main Appium server. It is almost same as Selenium server which perceives HTTP requests from selenium client libraries and it handles those requests in different ways depending upon the platforms. Each vendor like iOS and Android have a different way and mechanism to run a test case on the device so Appium kind of hacks in to it and run this testcase after listening commands from Appium server
Please Note that the below setup has been done and tested on MAC OS Make sure you have the latest mac (since xcode version is dependent on your mac os version) version and your editor is updated
- Install Brew, Node & npm on your machine via iterm
brew tap caskroom/versions
brew update
brew install carthage
brew install node
npm install -g npm
Check the Node & npm version
node --version
npm --version
- Install Latest Version of Java. I am installing Java 8 because it is the LTS Version (Long Term Support)
brew cask install java8
- Install Appium and Web driver globally
npm install -g appium
npm install wd
-
Download the Selenium, Selenium Stand Alone and Appium JAR's for Java Client Selenium JAR for JAVA Selenium Standalone JAR Appium Client Libraries
-
Install IntelliJ IDEA, and Go to File -> Project Structure -> Upload the JDK from local machine
-
For
Android Automation
, We need to install theAndroid Studio
Android Studio -
Update System Preferences, Open bash_profile in terminal:
nano ~/.bash_profile
Paste the below :
export ANDROID_HOME=/Users/User_name/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
SAVE AND EXIT TERMINAL
- Check that JAVA_HOME and ANDROID_HOME is set:
$echo $JAVA_HOME
$echo $ANDROID_HOME
- Open the
Android Studio
and go toPreferences -> System Settings -> Android SDK
& Download the Necessary Package.
- I use
Genymotion Virtual Emulator
for Android and i love it. You will ❤️ it too.
Follow the Steps to install Genymotion : https://docs.genymotion.com/Content/01_Get_Started/Installation.htm
- Launch Genymotion and Click "Settings"→ ADB and set the path for Android-SDK.
-
Select the Virtual Device Created and Click "Start".
-
Launch Appium and Navigate to Android Settings. Change the Capabilities as per the selected Virtual device.
-
Launch the Appium Inspector.
-
How to install .apk file into Genymotion Emulator :
-
To check the devices attached to the local machine
adb devices
-
adb install PATH_TO_APK
adb install /Users/USER_NAME/Workspace/qa_android_em_app/YourAPK.apk
- Install the
XCODE Dependencies
$ xcode-select --install
$ sudo xcode-select --reset
$ sudo xcode-select --switch /Applications/Xcode.app
$ brew install libimobiledevice --HEAD
There is also a dependency, made necessary by Facebook’s WebDriverAgent, for the Carthage dependency manager.
$ brew install carthage
Deviceconsole allows analyzing crash logs and console output from the device
$ npm install deviceconsole
Install and debug iPhone apps from the command line, without using Xcode
$ brew install ios-deploy
Xcpretty is a fast and flexible formatter for xcodebuild
$ gem install xcpretty
You need to authorize use of the iOS Simulator. If you’re only testing Android, this can be skipped.
$ npm install -g authorize-ios
$ authorize-ios
- Launch the IOS Simulator by opening XCODE or Launch it through command Line
-
See all the Available Simulator Devices Created along with
UDID
xcrun simctl list
-
Install and Launch the Application
xcrun simctl install <YOUR-DEVICE-ID> <PATH-TO-APPLICATION-BUNDLE> xcrun simctl launch <YOUR-DEVICE-ID> <BUNDLE-ID-OF-APP-BUNDLE>
-
Need Help?
xcrun simctl help
- Install
appium-doctor
to verify that all of Appium’s dependencies are met :
$ npm install -g appium-doctor
$ appium-doctor
$ appium-doctor --ios
$ appium-doctor --android
IMAGE HERE
- Install the
Inspector that you can use to look at your app's elements, get basic information about them, and perform basic interactions with them
I Suggest the Following based on my experience :
IOS
- Appium Desktop
Android
- UI Automator Viewer
-
Install Brew, Node & NPM
-
Install Java, JDK and export Path to bash file
-
Install Appium Globally
-
Download Selenium, Appium and Selenium Standalone JARS
-
Add External JARS to Java Build Path
-
Install Android Studio and download the packages
-
Install Genymotion Emulator and Launch the Emulator
-
Install Xcode Dependencies
-
Install IOS Simulator via terminal
-
Install Appium Doctor and check if all Appium dependencies are met for
Android
&IOS
-
Inspector for
Android
&IOS
-
Creation One-time Configuration of
DesiredCapabilities
forIOS
-
Creation One-time Configuration of
DesiredCapabilities
forAndroid
-
Installing Dependencies for CI tool
If you need any help with the installation, please contact me on anoop.ambunhi@gmail.com