Appium Setup - Jaikishan
Appium Setup - Jaikishan
Mobile Application: Any software application designed for use on mobile devices, such as
smartphones and tablets, rather than desktop or laptop computers is mobile application.
There are 3 types of mobile app – Native, Hybrid, Mobile web app.
Native apps – A native app is written in the programming language specific for a platform, the
most popular being Objective-C or Swift for Apple devices and Java for Android devices.
Ex: Facebook, Sulekha, Myntra
Hybrid apps – A hybrid app is a web app that translates to native code on a platform like
iPhone or Android. Hybrid apps have a wrapper around a “webview” – a native control that
enables interaction with web content.
Ex: Houzify, LinkedIN, makeMyTrip, Ebay
Mobile web app -- apps are web apps accessed using a mobile browser. A web app is an app
written in web code that is similar to a website but more interactive so it feels like an app on
mobile devices. It is again acccesible through browser interface. Appium supports Safari on iOS
and Chrome or the built-in ‘Browser’ app on Android.
Open Source Licensed
Appium[Android and iOS] Renorex[Android and iOS]
Calabash[Android and iOS] Keynote[Android and iOS]
Robotium[Android] Experitest[Android and iOS]
Selendriod[Android]
iOS Driver[iOS]
Frank[iOS]
What is Appium?
Appium is mobile web, native and hybrid software application test automation tool and is
open source. It can be used to automate android and IOS platform apps. Supports mulitiple
platforms Android, IOS and Firefox OS platforms of mobile. It is cross-platform automation
tool as we can tests against IOS and Android platforms using same api. It supports tests on
emulator, simulator and physical mobile devices too.
Advantages:
• It provides multiple platforms support.
• It provides multiple languages support.
o With the Selenium WebDriver API, it supports multiple language-specific client
libraries. Java, Objective-C, JavaScript with node.js, PHP, Python, Ruby, C#, Perl.
• No source code is required,
Limitations:
• Do not support for android version 4.1 or lesser than that.
• Some gestures are not supported
• Windows mobile are not supported
• Image comparison are not supported.
Note: Appium supports api level 17 and greater. Thus version of the android needs to be 4.2 or
greater. Below this, selendroid supports automation.
Appium Setup:
1. Install JDK
• Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html of
software web application.
• Click on JDK download button as shown in bellow image.
• It will take you to Java SE Development Kit 8 Downloads page.
• Tick "Accept License Agreement" radio button and click on .exe link to download JDK
based on your OS as shown in bellow image. Select "Windows x86" for 32 bit system and
"Windows x64" for 64 bit system.
• When you will click on link, It will show you dialog to save .exe file.
• Double click on downloaded .exe file.
• It will launch JDK software installation dialog as bellow.
• Click on Next button on each step using default selections. It will take some time to
install JDK and at last of installation, It will show screen like bellow to close installation
dialog.
• Java is installed now. Now you need to set JAVA_HOME variable in windows. Bellow
given steps will set it.
It will set JDK bin folder path in your system environment variable.
System Requirements
• 4 GB RAM minimum.
• Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
• 60 GB Hard disk space.
Now close all dialog by clicking on OK buttons of all opened dialog as shown in above
image.
• Navigate to http://appium.io/
• Click on Download Appium button. It will download zip file.
• When download completes, Extract zip file.You will get AppiumForWindows folder.
• Double click on "appium-installer.exe" file to install appium.
• Select default settings and finish the installation process.
• Launch Appium.
Install
• Connect your android phone with PC with USB debugging mode enabled.
• Double click on PDANet+ installation .exe file.
• It will open PDANet+ installation dialog.
• Proceed for installation with default selected options and settings on each screen
of installation dialog.
Appium Installation full setup on Mac for real device iOS Automation.
4. Install Node.js
5. Install npm
--> In Terminal install npm:
brew update
brew install node
npm install -g npm
6. To setup Environment
or
open -e .bash_profile
If bash profile not available, create a bash_profile by following command
Start up Terminal
Type "cd ~/" to go to your home folder
Type "touch .bash_profile" to create your new file.
Edit .bash_profile with your favorite editor (or you can just type "open -e
.bash_profile" to open it in TextEdit.
paste following:
export ANDROID_HOME=/Users/user/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export
JAVA_HOME=$(/Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk)
export PATH=${JAVA_HOME}/Contents/Home/bin:$PATH
export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH
export PATH=$PATH:/opt/bin:$PATH
save (Ctrl+S) and exit
NOTE : As default Android studio and Java takes the above path, if you
have changed the path then do change it here with correct version
Now type the following command to get into WebDriverAgent and Install
carthage:
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-
driver/WebDriverAgent
npm i -g webpack
From above steps do 'cd' to get out of all subfolders and then type
'appium'
- cd
- appium
- Contents -> Resources -> app -> node_modules -> appium ->
node_modules-> appium-xcuitest-driver -> WebDriverAgent
In terminal do 'cd' space and drag the WebDriverAgent folder and make
sure that you are in WebdriverAgent folder and follow the below
command
mkdir -p Resources/WebDriverAgent.bundle
./Scripts/bootstrap.sh -d
Step 10 : Two pieces of software are currently necessary to run iOS tests
on real devices:
Type 'cd' in terminal to get out of sub folders and follow the below
commands
1. brew install libimobiledevice --HEAD
2. brew install ideviceinstaller
3. brew install carthage
4. npm install -g ios-deploy
5. gem install xcpretty
Step 11 : Open WebDriverAgent.xcodeproj in Xcode.
Now Go to WebDriverAgent folder as mentioned above in terminal
and Open WebDriverAgent.xcodeproj in Xcode.
For both the WebDriverAgentLib and WebDriverAgentRunner targets,
select "Automatically manage signing" in the "General" tab, and then
select your Development Team. This should also auto select Signing
Ceritificate
By going into the "Build Settings" tab, and changing the "Product Bundle
Identifier" from com.facebook.WebDriverAgentRunner to something that
'com.twitter.WebDriverAgentRunner' and enter so that Xcode will accept
Going back to the "General" tab for the WebDriverAgentRunner target,
you should now see that it has created a provisioning profile and all is
well
Refer below link for more information
https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-
device-config.md