0% found this document useful (0 votes)
42 views13 pages

Appium Setup - Jaikishan

Uploaded by

akmajith1998
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views13 pages

Appium Setup - Jaikishan

Uploaded by

akmajith1998
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Appium

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.

Set JAVA_HOME Variable In Windows


After installation of java software, You need to set JAVA_HOME variable in your windows
system Steps to set JAVA_HOME are as bellow.
1. Locate JDK Installation folder path
First of all you need to locate path of JDK installation folder.
For that,
• Go to C:\Program Files\Java.
• There will be JDK folder with version number. Example : For me it is "jdk1.8.0_45".
• Double click on It.
• Copy folder path. Example : C:\Program Files\Java\jdk1.8.0_45
This path will be required to set environment variable as described in bellow given steps.
2. Set JAVA_HOME Variable
• Right click on My Computer icon which is located on your desktop or win start.
• Select Properties
• It will open system configuration dialog.
• Click on Advanced system settings as shown in bellow image. It will open system
properties dialog.
• Select advanced tab -> Click on Environment Variables button. It will open Environment
Variables dialog.
• Under System Variable, Click on New button. It will open New System Variable dialog.
• Set Variable name = JAVA_HOME.
• Set Variable Value = Path where JDK is located. For me It is "C:\Program
Files\Java\jdk1.8.0_45" which is located during previous step as described above . It
depends on your own java installation path and installed version.
• Close all dialog by clicking on OK buttons as described in above image.

3. Set Path Variable For Java


Also you need to set JDK's bin folder path in path variable of system variables. You will find
bin folder inside your JDK folder. To set path system variable of JDK,
• Open Environment Variables dialog as described above.
• Under System Variable select Path variable.
• Click on Edit button. It will open Path system variable edit dialog.
• At the end of Path variable value string, Put semicolon and then put JDK folder's bin
folder path.
• Click on OK button to close all opened dialog. See bellow given image for more
reference.

It will set JDK bin folder path in your system environment variable.

4. Verify java is installed properly or not


To verify java software is installed properly or not,
• Open command prompt.
• Run command "java -version".

It should show your installed java version detail

2. To Download And Install Android SDK In Windows


Android SDK is software development kit which enables you to create applications for android
platform. Also it provides ability to create emulators to test android apps. Android SDK is
prerequisite to run tests on android platform on both android devices or emulators using
appium.
JDK is prerequisite to installing SDK.
Android SDK Download And Installation.

System Requirements
• 4 GB RAM minimum.
• Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
• 60 GB Hard disk space.

Download Android SDK


• Navigate to Website ‘http://developer.android.com/sdk/index.html
• Go to the bottom of the page until Get just the command line tools
• Click on ‘android-sdk_r24.4.1-windows.zip’
• It will download android SDK zip file, Unzip and extract the file to proper folder.

Install Required Packages


Now, we need to download and install few packages. We can do it using Android SDK
Manager.
• Look for SDK Manger.exe inside extracted android-sdk folder.
• Double click and open SDK Manager Dialog.
• Select Tools, Extras and required android version package relevant to your android
device.
• Preferably select all the android versions above 4.4.2.

Set ANDROID_HOME and Path Environment Variables


We need to set ANDROID_HOME and path environment variables for describing path of
android SDK folders to your operating system.
Open "Environment Variables" dialog from win start menu -> Right click on My Computer -
> Select properties -> Advanced system settings -> Environment Variables button from
Advanced tab.
Click on New button under System Variable table. It will open New System Variable dialog.
Set Variable Name = ANDROID_HOME and Variable value = (Path of SDK folder). Path can
be different for you as per your SDK folder location as per your installation.
Click on OK button to close New System Variable dialog.

Set Path Variables


• Open SDK Folder, You will find "tools" and "platform-tools" folders inside SDK folder.
• Copy path of both these folders. Open "Environment Variables"
• Locate Path variable line under System Variables table.
• Edit Path variable by clicking on Edit button. It will open Edit System Variables dialog.
• Append "tools" and "platform-tools" folder's full path at the end of line with ‘;’.

Now close all dialog by clicking on OK buttons of all opened dialog as shown in above
image.

Now to verify android installation:


Open Command prompt, type android text, Andriod SDK Manager dialog should be
displayed.

3. Install Eclipse ADT Plugin To Use Android SDK With Eclipse


To integrate android SDK with eclipse IDE to access SDK tools in eclipse IDE, Android offers
plugin called Android Developer Tools (ADT) to integrate android development
environment in eclipse IDE.
• Open eclipse IDE
• Go to Help -> Install New Software. It will open Install software dialog.
• Click on Add button as shown in bellow image. It will open Add Repository dialog.
• Set URL as ‘https://dl-ssl.google.com/android/eclipse/” in location text box and click Ok
button.
• Select all check box of developer tools, Click Next, Accept the license radio button, Click
OK.
• It will start installing ADT plugin
• On completion of ADT plugin, It will ask you to restart eclipse IDE.

ADT Plugin is installed in eclipse

Set SDK Location


• On Eclipse, Select Windows -> Preferences.
• Select Android on Preferences dialog.
• Set SDK folder path in SDK Location box.

Verify Android SDK configured properly with eclipse


Go to Eclipse IDE's Windows menu -> Select Android SDK Manager.
It will open Android SDK Manager dialog
This confirms that android SDK is integrated properly with eclipse IDE using ADT plugin.

4. To Download And Install Microsoft .Net Framework


To download Microsoft .Net Framework,
• In google, search for "download latest version of Microsoft .Net Framework" keyword.
• It will show you latest version download link, Current version is 4.6.
• Click on Download to download .exe file.
• Double click on .Net framework installation .exe file.
• It will open .Net framework installation dialog.
• Proceed for installation with default selected options and settings on each screen
of installation dialog.

5. To Download and Install Appium


Pre-Requistes:
Before download and install appium in windows, Please make sure bellow given prerequisites are fulfilled.
1. JDK Installed.
2. Android SDK Installed.
3. Set ANDROID_HOME and Path Environment Variables.
4. Eclipse ADT Plugin Installed.
5. Microsoft .Net Framework, Node JS and PDANet+ for Android Installed.

• 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.

6. To Download And Install PDANet+ for Android


You need to install this software only if you not able to detect your connected device in PC.
• Search PDANet+ in google, goto Download page.
• Click on Download button, click on the link to download exe file.

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.

7. Connect Andriod Device with PC in USB Debugging mode.


We need to connect real android device with PC in USB debugging mode in order to run
android app automation tests in real android device using appium.

Enable Developer Option In Android Device


• Go to Settings.
• Check if there is any option like "Developer Option"? – If displayed, then developer
option is enabled.
To enable Developer Option in android device,
• Go to Settings.
• Scroll down to bottom and tap on About Phone.
• Scroll down bottom again on About Phone screen. You will see option Build number.
• Tap for 3 or 5 or 7 times, It will show you a message ‘You are now a developer!".
• Now go back to Settings and scroll down bottom.
• You will see option Developer Options above About Phone.

To start USB Debugging mode,

• Connect your device with PC using USB cable.


• Go to Settings -> Developer options.
• There will be option USB debugging with check box. Check it.
• It will ask you to "Allow USB debugging?". Tap on OK.

Test if device is connected and detected by android


• Open command prompt in your PC.
• Navigate to folder path platform-tools say cd ‘D:\Appium Downloads\android-
sdk_r24.3.4-windows\android-sdk-windows\platform-tools’
• Run command adb devices.

It will show you list of connected devices with your PC

Appium Installation full setup on Mac for real device iOS Automation.

Here I have displayed the procedure for the complete installation of


Appium in mac for real device iOS automation.

1.Install java JDK:


-- > Download Link here
: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-
downloads-2133151.html

2. Install Android Studio:

--> Download Link here: https://developer.android.com/studio/index.html

Scroll till last and find the software as below:


android-studio-ide-173.4819257-mac.dmg

3. Install Home brew

--> In Terminal install brew:


ruby -e "$(curl -
fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

4. Install Node.js

--> install node.js:

download installer: https://nodejs.org/en/download/ and run

5. Install npm
--> In Terminal install npm:
brew update
brew install node
npm install -g npm

6. To setup Environment

To open bash_profile in terminal, type the following command:


nano ~/.bash_profile

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

Step 7. Install Appium

In Terminal install Appium command line:


npm install -g appium@1.6.0-beta1
npm install wd

Step 8. Install Carthage

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

brew install carthage

npm i -g webpack

Step 9. Run Appium in command line

From above steps do 'cd' to get out of all subfolders and then type
'appium'

- cd
- appium

If everything works correct you should get the following line

[Appium] Welcome to Appium v1.6.0-beta1


[Appium] Appium REST http interface listener started on 0.0.0.0:4723

Step 7 : Download Appium Desktop

--> Download Link : https://bitbucket.org/appium/appium.app/downloads/

Download the available version for your convenient as 'dmg' file, as my


suggestion don't go with the recent release version there might be an
issue or bug will exist. So I'd prefer to go with the previous version of
latest release version.

Step 8 : Installation Appium Desktop

Once installed Go to 'Application' and right click on 'Appium Desktop'


(What you have Downloaded and installed) to show package contents.
Then follow the subfolders to get in

- Contents -> Resources -> app -> node_modules -> appium ->
node_modules-> appium-xcuitest-driver -> WebDriverAgent

Step 9 : Setup Webdriver Agent Server

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy