(Go: >> BACK << -|- >> HOME <<)

SlideShare a Scribd company logo
Appium
Getting started with Appium
&
Setup first Project.
Outline What is Appium?
Install Appium and other Tools
Setup the Project
Import my Project
What is Appium?
➔ APPIUM is a freely distributed open source mobile
application UI Testing framework. It is used to test
the UI of mobile application.
➔ Appium allows native, hybrid and web application
testing and supports automation test on physical
devices as well as on emulator or simulator both.
➔ It offers cross-platform application testing i.e. single
API works for both Android and iOS platform test
scripts.
How it works?
➔ It has NO dependency on Mobile device OS. Because, APPIUM has framework or wrapper
that translate Selenium Webdriver commands into UIAutomation (iOS) or UIAutomator
(Android) commands depending on the device type not any OS type.
➔ Appium supports all languages that have Selenium client libraries like- Java, Objective-C,
JavaScript with node.js, PHP, Ruby, Python, C# etc.
Appium architecture For more info. | http://appium.io/introduction.html
Install Appium
&
Other Tools
Installation of Appium differs on:
● Mac / Linux
● Windows
Note: We mainly focus on Windows Installation for
Android
STEPS(for Mac) :
> brew install node # get node.js
> npm install -g appium # get appium
> npm install wd # get appium client
> appium & # start appium
> node your-appium-test.js
Prerequisites: ANDROID_HOME variable must be saved and pointed to
Android SDK
NOTE: Here test written on JavaScript
Installation on
MAC / Linux
It is bit easy to install appium on Mac/Linux
compared to Windows
Installation on
Windows
We will be focused on Windows
Installation
Tools Needed
● Java
● Gradle
● Android SDK (Android Studio)
● Node.js
● Appium Desktop Server
● Intellij Idea
➔ Install Java from here
➔ Please check JAVA_HOME variable is saved and pointed to jdk
◆ You can check it by ‘java -version’ command on command prompt.
JAVA
➔ Gradle is an open-source build automation system that builds upon the concepts of Apache Ant
and Apache Maven. It is a JVM based build system
➔ Install the binary files from here
➔ Create a new directory ‘C:Gradle’ with File Explorer.
➔ Under System Variablesselect Path, then click Edit. Add an entry for C:Gradlegradle-X.Y.Zbin.
Click OK to save.
➔ Open a Windows command prompt and run gradle -vto run gradle and display the version
◆ $ gradle -v
------------------------------------------------------------
Gradle 4.5.1
------------------------------------------------------------
Gradle (Build Tool)
➔ Install Android Studio from here
➔ Install & Open Android Studio then download the needed Android SDK files from Tools > Android
> SDK Manager
➔ Under User Variablesthen click New. Add an entry for Variable: ANDROID_HOME and set Value:
Pathtosdk. Click OK to save.
➔ Verify it on Command prompt using echo %ANDROID_HOME% command, it must display the SDK path
Android SDK (Android Studio)
➔ Install Node.js from here
➔ You can verify installation by entering npm -v command on command prompt, it will display the
version
Node.js
➔ Download and Install Appium Desktop from here
➔ Open Android Desktop exe file and Start the server
➔ A Terminal should appear saying ‘The server is running’
Appium Desktop Server
➔ Download and Install IntelliJ Idea from here.
➔ Make sure TestNG plugin is installed and enabled
➔ This is the IDE we will be using for writing the Test Cases
Intellij Idea
Setup the
Project
IDE : IntelliJ Idea
Platform : Windows
Mobile OS : Android
Build System : Gradle
Prog. Lang. : Java
Create New
Project
1. Open IntelliJ Idea
2. Create New Project with Gradle and Java
3. Specify the GroupId and ArtifactId and
click on Next
4. Just make sure ‘Use default gradle
wrapper(recommanded)’ option must be
selected and Gradle JVM is specified. Then click
Next
5. Verify project name, location then click on
Finish
- It will build the project and IDE is ready to
use
1. You need to specify the
dependencies in build.gradle file
- Just open this link and copy paste
- You can learn more about gradle
here
Create Appium
Test Cases
In build.gradle file we have specified the dependencies, when build.gradle file executed by gradle daemon
it will download all the dependencies files from relevant server and import it to project. Below mentioned
files must be needed in order to run the appium test case.
1. TestNG: We are using this dependency although there is inbuilt support of it intelliJ
2. Selenium(Java): Appium is wrapper around Selenium, So it must be installed and imported
3. Appium Client(Java): This is the Java language binding for writing Appium Tests, conforms to
Mobile JSON Wire Protocol
View dependencies in build.gradle file here
Gradle Dependencies
2. Create Java Class for Appium Test case
- Right click on Java folder
- Create New > Java Class
1. Set location of the application to test in the desired capabilities of the test script.
2. Create an Appium driver instance which points to a running Appium server
3. Locate an element within the native application.
4. Perform an action on the element.
5. Anticipate the application response to the action.
6. Run tests and record test results using a test framework.
7. Conclude the test.
7 basic steps to create Appium test script
They tell the Appium drivers all kinds of important things about how you want your test to work. Desired
Capabilities are keys and values encoded in a JSON object.
{
"platformName": "Android",
"platformVersion": "8.0",
"deviceName": "devicename",
"appWaitPackage": "com.abc.xyz",
"appActivity": "com.abc.xyz.MainActivity",
"app": "/path/to/my.apk"
}
More about DesiredCapabilities: https://appium.io/docs/en/writing-running-appium/caps/
1) Desired Capabilities
In Java file you can set capabilities like below:
@Before
public void setUp() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, “devicename”);
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(“platformVersion”, “8.0”);
capabilities.setCapability(“appPackage”, “com.abc.xyz”);
capabilities.setCapability(“appActivity”, “com.abc.xyz.MainActivity”);
}
Generally capabilities must be set at BeforeClass level, so when test execution get stareted capabilities set at
first.
In order to execute Appium Test Cases we need to start Appium Server first.
1. Just open Appium Desktop exe file and Start the Server
2. After setting the Desired Capabilities you need to create Appium driver instance, you can achieve this
using:
protected AppiumDriver<MobileElement> driver;
String appiumServerUrl = “http://localhost:4723/wd/hub”;
driver = new AppiumDriver<MobileElement>(new URL(appiumServerUrl), capabilities);
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
3. Driver is the main object for appium, you will extract the elements using it
2) Appium Server
There are various strategies to locate the element by css, name, id, class name, xpath, linkText etc.
But mostly used strategy in case of Android is resource-id
There are mainly 2 ways to find the locators for Mobile App.
1) Appium Inspector Session
2) Android SDK’s uiautomatorviewer
3) Locate an Element
1) Appium Inspector Session
● Start Appium Server
● Start Appium Inspector Session by
clocking on SearchBox icon
● Fill all needed Desired Capabilities
● Start Session
● Click on Any UI element you want the locator for and find the id on right side panel, you can use that
id on code for finding that element. You need to use driver instance for that.
● MobileElement el = driver.findElementById("com.google.android.apps.messaging:id/next")
2) uiautomatorviewer
● Move to Android_SDK/tools/bin, and
open uiautomatorviewer
● Click on any UI element you want
locator for and you will find all details,
pick the resource-id text
● You can use el instance perform various actions like click, type etc.
● el.click(); will click on element
● el.sendKeys("Test"); will type ‘Test’ on field
● el.getText()will return the text of element.
You can learn about webelement class here.
4) Perform an action on the Element
While using Appium(Selenium) for automated testing of web/mobile applications, we need to add validations
in our tests to report them as pass or fail. And assertions can let us do that within a single line of code.
Main goal of Test Case is to compare Actual value with Expected Value. We Call this Assertions.
For Assertions we need to use external libraries like TestNG or JUnit
There are primarily 2 types of Assertions we can make on Element(For UI Testing)
1) Compare the Text values of elements and verify the result
2) Verify whether expected element is present on UI
If you are using TestNG then there are two types of assertions. Hard and Soft assert, you can learn it here.
5) Anticipate the Application response
6) Run Tests
● Make Test cases using @Test
annotation
● Write the test case code and put
assertions
● Select Test case name and do right
click then do click on option Run ‘test
case name’
● It will execute the test case and
meantime you can see the logs for
details. You can also put debug points
between your code.
● At last build result and report will be
generated.
After test case execution build results and log will be generated, using it you will get to know that which test
cases have been passed or failed.
If your test case has failed then there can be 2 reason:
1) Problem with the code of Test Case
2) New changes introduced in app
From the analysis of the log and deep debugging you will get to know the exact root cause of failure and you
should fix that.
7) Conclude the test
Import my
Project
There is a sample project on Github, you can import it,
change some configuration and run:
◆ Download Project
◆ Connect Android device with PC properly
◆ Import project in IntelliJ
● Click on Import Project
● Select build.gradle file and click Next
● Make sure ‘Use default gradle wrapper’ &
Gradle JVM is selected properly.
● Change platform.android.version &
device.name in configuration.properties
file(according to connected device)
● Run test cases from TestCases.java file
Other similar project
Why Appium is Best?
As you can see, Appium has far more advantages
than do the other tools available on the market.
However, it’s definitely not perfect.
Any given instrument has its strong and weak sides,
let’s see it in brief in next slides.
Pros
● Appium supports Android and iOS platforms. Code, programming languages and user experience
remains the same for both.
● Appium doesn’t require any in-app modifications for testing. An application can be tested right
after it’s been downloaded and installed on the device.
● SauceLabs, the guys in charge of Appium, specify in creating various well-known open source
automation and manual testing solutions. As a result, Appium is frequently updated and each new
release includes new useful features and bug fixes.
● This tool allows automating web, native and hybrid applications, while also offering support for
various hardware actions.
● Appium supports all Webdriver-compatible programming languages: Java, Objective-C, JavaScript
with Node.js, PHP, Python, Ruby, C#, Clojure and Perl.
Cons
● Appium doesn’t support image recognition.
● Such hardware actions as swipe and gestures work only in native applications.
● It is impossible to execute parallel iOS tests. If you want to run tests on multiple devices at once,
you’d have to do so on the corresponding number of Mac OS PCs, as Macs only allow executing one
instance per device. This limitation may cause a lot of problems with Continuous Integration.
However, you could easily fix it by executing tests in the SauceLabs’ mobile cloud, which allows
running tests on multiple iOS simulators at once.
● It takes a long time to install and setup Appium for both iOS and Android.
● Appium’s got a very weak sort of documentation, which can be a pain for some engineers.
`
Assumptions
Viewer must have basic knowledge of:
● Testing
● Java
● Programming
Viewer must have(In order to execute the testcase)
● Connected Android working device with PC
Questions?
References
Appium Getting Started
Selenium
Gradle
TestNG
My Github Project
THANK YOU!
- PRATIK PATEL

More Related Content

What's hot

Automation using Appium
Automation using AppiumAutomation using Appium
Automation using Appium
Livares Technologies Pvt Ltd
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With Appium
Knoldus Inc.
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
Mindfire Solutions
 
Appium
AppiumAppium
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with Appium
Manoj Kumar Kumar
 
Mobile Testing with Appium
Mobile Testing with AppiumMobile Testing with Appium
Mobile Testing with Appium
Knoldus Inc.
 
Automation testing on ios platform using appium
Automation testing on ios platform using appiumAutomation testing on ios platform using appium
Automation testing on ios platform using appium
Ambreen Khan
 
Introduction To Mobile-Automation
Introduction To Mobile-AutomationIntroduction To Mobile-Automation
Introduction To Mobile-Automation
Mindfire Solutions
 
What is Appium? Edureka
What is Appium? EdurekaWhat is Appium? Edureka
What is Appium? Edureka
Edureka!
 
Getting started with Appium 2.0
Getting started with Appium 2.0Getting started with Appium 2.0
Getting started with Appium 2.0
Anand Bagmar
 
Mobile automation using Appium
Mobile automation using AppiumMobile automation using Appium
Mobile automation using Appium
Saroj Singh
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
Ramakrishna Telapolu
 
Mobile Application Testing Strategy
Mobile Application Testing StrategyMobile Application Testing Strategy
Mobile Application Testing Strategy
ankitQA
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testing
Tharindra Jayamaha
 
Mobile application testing tutorial
Mobile application testing tutorialMobile application testing tutorial
Mobile application testing tutorial
Lokesh Agrawal
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
Mithilesh Singh
 
Mobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training Presentation
MobiGnosis
 
Introduction to AWS Device Farm
Introduction to AWS Device FarmIntroduction to AWS Device Farm
Introduction to AWS Device Farm
Amazon Web Services
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
SWAAM Tech
 
Appium an introduction
Appium   an introductionAppium   an introduction
Appium an introduction
Vivek Shringi
 

What's hot (20)

Automation using Appium
Automation using AppiumAutomation using Appium
Automation using Appium
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With Appium
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 
Appium
AppiumAppium
Appium
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with Appium
 
Mobile Testing with Appium
Mobile Testing with AppiumMobile Testing with Appium
Mobile Testing with Appium
 
Automation testing on ios platform using appium
Automation testing on ios platform using appiumAutomation testing on ios platform using appium
Automation testing on ios platform using appium
 
Introduction To Mobile-Automation
Introduction To Mobile-AutomationIntroduction To Mobile-Automation
Introduction To Mobile-Automation
 
What is Appium? Edureka
What is Appium? EdurekaWhat is Appium? Edureka
What is Appium? Edureka
 
Getting started with Appium 2.0
Getting started with Appium 2.0Getting started with Appium 2.0
Getting started with Appium 2.0
 
Mobile automation using Appium
Mobile automation using AppiumMobile automation using Appium
Mobile automation using Appium
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Mobile Application Testing Strategy
Mobile Application Testing StrategyMobile Application Testing Strategy
Mobile Application Testing Strategy
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testing
 
Mobile application testing tutorial
Mobile application testing tutorialMobile application testing tutorial
Mobile application testing tutorial
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
 
Mobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training Presentation
 
Introduction to AWS Device Farm
Introduction to AWS Device FarmIntroduction to AWS Device Farm
Introduction to AWS Device Farm
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Appium an introduction
Appium   an introductionAppium   an introduction
Appium an introduction
 

Similar to Getting started with appium

A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
flufftailshop
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
Oleksii Prohonnyi
 
Using galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testingUsing galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testing
Sarah Elson
 
Appium- part 1
Appium- part 1Appium- part 1
Appium- part 1
Mithilesh Singh
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
Luke Maung
 
Final NEWS.pdf
Final NEWS.pdfFinal NEWS.pdf
Final NEWS.pdf
RebaMaheen
 
Final NewsApp.pdf
Final NewsApp.pdfFinal NewsApp.pdf
Final NewsApp.pdf
RebaMaheen
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
lancelotlaytan1996
 
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfBuilding And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
pCloudy
 
Android Automation Using Robotium
Android Automation Using RobotiumAndroid Automation Using Robotium
Android Automation Using Robotium
Mindfire Solutions
 
Android programming-basics
Android programming-basicsAndroid programming-basics
Android programming-basics
Aravindharamanan S
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introduction
snevesbarros
 
Appium solution
Appium solutionAppium solution
Appium solution
Nael Abd Eljawad
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue Solutions
RapidValue
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
DicodingEvent
 
Appium understanding document
Appium understanding documentAppium understanding document
Appium understanding document
Akshay Pillay
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
TOPS Technologies
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
RubenGray1
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
Bird.pdf
 Bird.pdf Bird.pdf
Bird.pdf
RebaMaheen
 

Similar to Getting started with appium (20)

A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
 
Using galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testingUsing galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testing
 
Appium- part 1
Appium- part 1Appium- part 1
Appium- part 1
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Final NEWS.pdf
Final NEWS.pdfFinal NEWS.pdf
Final NEWS.pdf
 
Final NewsApp.pdf
Final NewsApp.pdfFinal NewsApp.pdf
Final NewsApp.pdf
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfBuilding And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
 
Android Automation Using Robotium
Android Automation Using RobotiumAndroid Automation Using Robotium
Android Automation Using Robotium
 
Android programming-basics
Android programming-basicsAndroid programming-basics
Android programming-basics
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introduction
 
Appium solution
Appium solutionAppium solution
Appium solution
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue Solutions
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 
Appium understanding document
Appium understanding documentAppium understanding document
Appium understanding document
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
An Overview of Angular 4
 
Bird.pdf
 Bird.pdf Bird.pdf
Bird.pdf
 

Recently uploaded

YouTube SEO Mastery ......................
YouTube SEO Mastery ......................YouTube SEO Mastery ......................
YouTube SEO Mastery ......................
islamiato717
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
shivamt017
 
BoxLang Developer Tooling: VSCode Extension and Debugger
BoxLang Developer Tooling: VSCode Extension and DebuggerBoxLang Developer Tooling: VSCode Extension and Debugger
BoxLang Developer Tooling: VSCode Extension and Debugger
Ortus Solutions, Corp
 
Top 10 Tips To Get Google AdSense For Your Website
Top 10 Tips To Get Google AdSense For Your WebsiteTop 10 Tips To Get Google AdSense For Your Website
Top 10 Tips To Get Google AdSense For Your Website
e-Definers Technology
 
Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
Ortus Solutions, Corp
 
dachnug51 - HCLs evolution of the employee experience platform.pdf
dachnug51 - HCLs evolution of the employee experience platform.pdfdachnug51 - HCLs evolution of the employee experience platform.pdf
dachnug51 - HCLs evolution of the employee experience platform.pdf
DNUG e.V.
 
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Estuary Flow
 
Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?
Ortus Solutions, Corp
 
Web Hosting with CommandBox and CommandBox Pro
Web Hosting with CommandBox and CommandBox ProWeb Hosting with CommandBox and CommandBox Pro
Web Hosting with CommandBox and CommandBox Pro
Ortus Solutions, Corp
 
How to Break Your App with Playwright Tests
How to Break Your App with Playwright TestsHow to Break Your App with Playwright Tests
How to Break Your App with Playwright Tests
Ortus Solutions, Corp
 
Java SE 17 Study Guide for Certification - Chapter 02
Java SE 17 Study Guide for Certification - Chapter 02Java SE 17 Study Guide for Certification - Chapter 02
Java SE 17 Study Guide for Certification - Chapter 02
williamrobertherman
 
@ℂall @Girls Kolkata ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
@ℂall @Girls Kolkata  ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe@ℂall @Girls Kolkata  ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
@ℂall @Girls Kolkata ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
Misti Soneji
 
Development of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML TechnologiesDevelopment of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML Technologies
MaisnamLuwangPibarel
 
Java SE 17 Study Guide for Certification - Chapter 01
Java SE 17 Study Guide for Certification - Chapter 01Java SE 17 Study Guide for Certification - Chapter 01
Java SE 17 Study Guide for Certification - Chapter 01
williamrobertherman
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
onemonitarsoftware
 
@Call @Girls in Solapur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
 @Call @Girls in Solapur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S... @Call @Girls in Solapur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
@Call @Girls in Solapur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
Mona Rathore
 
Securing Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecuritySecuring Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecurity
Ortus Solutions, Corp
 
@Call @Girls in Saharanpur 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
 @Call @Girls in Saharanpur 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas... @Call @Girls in Saharanpur 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
@Call @Girls in Saharanpur 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
AlinaDevecerski
 
NYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdfNYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdf
AUGNYC
 
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
arvindkumarji156
 

Recently uploaded (20)

YouTube SEO Mastery ......................
YouTube SEO Mastery ......................YouTube SEO Mastery ......................
YouTube SEO Mastery ......................
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
 
BoxLang Developer Tooling: VSCode Extension and Debugger
BoxLang Developer Tooling: VSCode Extension and DebuggerBoxLang Developer Tooling: VSCode Extension and Debugger
BoxLang Developer Tooling: VSCode Extension and Debugger
 
Top 10 Tips To Get Google AdSense For Your Website
Top 10 Tips To Get Google AdSense For Your WebsiteTop 10 Tips To Get Google AdSense For Your Website
Top 10 Tips To Get Google AdSense For Your Website
 
Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
 
dachnug51 - HCLs evolution of the employee experience platform.pdf
dachnug51 - HCLs evolution of the employee experience platform.pdfdachnug51 - HCLs evolution of the employee experience platform.pdf
dachnug51 - HCLs evolution of the employee experience platform.pdf
 
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
 
Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?
 
Web Hosting with CommandBox and CommandBox Pro
Web Hosting with CommandBox and CommandBox ProWeb Hosting with CommandBox and CommandBox Pro
Web Hosting with CommandBox and CommandBox Pro
 
How to Break Your App with Playwright Tests
How to Break Your App with Playwright TestsHow to Break Your App with Playwright Tests
How to Break Your App with Playwright Tests
 
Java SE 17 Study Guide for Certification - Chapter 02
Java SE 17 Study Guide for Certification - Chapter 02Java SE 17 Study Guide for Certification - Chapter 02
Java SE 17 Study Guide for Certification - Chapter 02
 
@ℂall @Girls Kolkata ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
@ℂall @Girls Kolkata  ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe@ℂall @Girls Kolkata  ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
@ℂall @Girls Kolkata ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
 
Development of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML TechnologiesDevelopment of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML Technologies
 
Java SE 17 Study Guide for Certification - Chapter 01
Java SE 17 Study Guide for Certification - Chapter 01Java SE 17 Study Guide for Certification - Chapter 01
Java SE 17 Study Guide for Certification - Chapter 01
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
 
@Call @Girls in Solapur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
 @Call @Girls in Solapur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S... @Call @Girls in Solapur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
@Call @Girls in Solapur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
 
Securing Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecuritySecuring Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecurity
 
@Call @Girls in Saharanpur 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
 @Call @Girls in Saharanpur 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas... @Call @Girls in Saharanpur 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
@Call @Girls in Saharanpur 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
 
NYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdfNYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdf
 
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
 

Getting started with appium

  • 1. Appium Getting started with Appium & Setup first Project.
  • 2. Outline What is Appium? Install Appium and other Tools Setup the Project Import my Project
  • 3. What is Appium? ➔ APPIUM is a freely distributed open source mobile application UI Testing framework. It is used to test the UI of mobile application. ➔ Appium allows native, hybrid and web application testing and supports automation test on physical devices as well as on emulator or simulator both. ➔ It offers cross-platform application testing i.e. single API works for both Android and iOS platform test scripts.
  • 4. How it works? ➔ It has NO dependency on Mobile device OS. Because, APPIUM has framework or wrapper that translate Selenium Webdriver commands into UIAutomation (iOS) or UIAutomator (Android) commands depending on the device type not any OS type. ➔ Appium supports all languages that have Selenium client libraries like- Java, Objective-C, JavaScript with node.js, PHP, Ruby, Python, C# etc.
  • 5. Appium architecture For more info. | http://appium.io/introduction.html
  • 6. Install Appium & Other Tools Installation of Appium differs on: ● Mac / Linux ● Windows Note: We mainly focus on Windows Installation for Android
  • 7. STEPS(for Mac) : > brew install node # get node.js > npm install -g appium # get appium > npm install wd # get appium client > appium & # start appium > node your-appium-test.js Prerequisites: ANDROID_HOME variable must be saved and pointed to Android SDK NOTE: Here test written on JavaScript Installation on MAC / Linux It is bit easy to install appium on Mac/Linux compared to Windows
  • 8. Installation on Windows We will be focused on Windows Installation Tools Needed ● Java ● Gradle ● Android SDK (Android Studio) ● Node.js ● Appium Desktop Server ● Intellij Idea
  • 9. ➔ Install Java from here ➔ Please check JAVA_HOME variable is saved and pointed to jdk ◆ You can check it by ‘java -version’ command on command prompt. JAVA
  • 10. ➔ Gradle is an open-source build automation system that builds upon the concepts of Apache Ant and Apache Maven. It is a JVM based build system ➔ Install the binary files from here ➔ Create a new directory ‘C:Gradle’ with File Explorer. ➔ Under System Variablesselect Path, then click Edit. Add an entry for C:Gradlegradle-X.Y.Zbin. Click OK to save. ➔ Open a Windows command prompt and run gradle -vto run gradle and display the version ◆ $ gradle -v ------------------------------------------------------------ Gradle 4.5.1 ------------------------------------------------------------ Gradle (Build Tool)
  • 11. ➔ Install Android Studio from here ➔ Install & Open Android Studio then download the needed Android SDK files from Tools > Android > SDK Manager ➔ Under User Variablesthen click New. Add an entry for Variable: ANDROID_HOME and set Value: Pathtosdk. Click OK to save. ➔ Verify it on Command prompt using echo %ANDROID_HOME% command, it must display the SDK path Android SDK (Android Studio)
  • 12. ➔ Install Node.js from here ➔ You can verify installation by entering npm -v command on command prompt, it will display the version Node.js
  • 13. ➔ Download and Install Appium Desktop from here ➔ Open Android Desktop exe file and Start the server ➔ A Terminal should appear saying ‘The server is running’ Appium Desktop Server
  • 14. ➔ Download and Install IntelliJ Idea from here. ➔ Make sure TestNG plugin is installed and enabled ➔ This is the IDE we will be using for writing the Test Cases Intellij Idea
  • 15. Setup the Project IDE : IntelliJ Idea Platform : Windows Mobile OS : Android Build System : Gradle Prog. Lang. : Java
  • 16. Create New Project 1. Open IntelliJ Idea 2. Create New Project with Gradle and Java
  • 17. 3. Specify the GroupId and ArtifactId and click on Next 4. Just make sure ‘Use default gradle wrapper(recommanded)’ option must be selected and Gradle JVM is specified. Then click Next
  • 18. 5. Verify project name, location then click on Finish - It will build the project and IDE is ready to use
  • 19. 1. You need to specify the dependencies in build.gradle file - Just open this link and copy paste - You can learn more about gradle here Create Appium Test Cases
  • 20. In build.gradle file we have specified the dependencies, when build.gradle file executed by gradle daemon it will download all the dependencies files from relevant server and import it to project. Below mentioned files must be needed in order to run the appium test case. 1. TestNG: We are using this dependency although there is inbuilt support of it intelliJ 2. Selenium(Java): Appium is wrapper around Selenium, So it must be installed and imported 3. Appium Client(Java): This is the Java language binding for writing Appium Tests, conforms to Mobile JSON Wire Protocol View dependencies in build.gradle file here Gradle Dependencies
  • 21. 2. Create Java Class for Appium Test case - Right click on Java folder - Create New > Java Class
  • 22. 1. Set location of the application to test in the desired capabilities of the test script. 2. Create an Appium driver instance which points to a running Appium server 3. Locate an element within the native application. 4. Perform an action on the element. 5. Anticipate the application response to the action. 6. Run tests and record test results using a test framework. 7. Conclude the test. 7 basic steps to create Appium test script
  • 23. They tell the Appium drivers all kinds of important things about how you want your test to work. Desired Capabilities are keys and values encoded in a JSON object. { "platformName": "Android", "platformVersion": "8.0", "deviceName": "devicename", "appWaitPackage": "com.abc.xyz", "appActivity": "com.abc.xyz.MainActivity", "app": "/path/to/my.apk" } More about DesiredCapabilities: https://appium.io/docs/en/writing-running-appium/caps/ 1) Desired Capabilities
  • 24. In Java file you can set capabilities like below: @Before public void setUp() throws MalformedURLException { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(“deviceName”, “devicename”); capabilities.setCapability(“platformName”, “Android”); capabilities.setCapability(“platformVersion”, “8.0”); capabilities.setCapability(“appPackage”, “com.abc.xyz”); capabilities.setCapability(“appActivity”, “com.abc.xyz.MainActivity”); } Generally capabilities must be set at BeforeClass level, so when test execution get stareted capabilities set at first.
  • 25. In order to execute Appium Test Cases we need to start Appium Server first. 1. Just open Appium Desktop exe file and Start the Server 2. After setting the Desired Capabilities you need to create Appium driver instance, you can achieve this using: protected AppiumDriver<MobileElement> driver; String appiumServerUrl = “http://localhost:4723/wd/hub”; driver = new AppiumDriver<MobileElement>(new URL(appiumServerUrl), capabilities); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); 3. Driver is the main object for appium, you will extract the elements using it 2) Appium Server
  • 26. There are various strategies to locate the element by css, name, id, class name, xpath, linkText etc. But mostly used strategy in case of Android is resource-id There are mainly 2 ways to find the locators for Mobile App. 1) Appium Inspector Session 2) Android SDK’s uiautomatorviewer 3) Locate an Element
  • 27. 1) Appium Inspector Session ● Start Appium Server ● Start Appium Inspector Session by clocking on SearchBox icon ● Fill all needed Desired Capabilities ● Start Session
  • 28. ● Click on Any UI element you want the locator for and find the id on right side panel, you can use that id on code for finding that element. You need to use driver instance for that. ● MobileElement el = driver.findElementById("com.google.android.apps.messaging:id/next")
  • 29. 2) uiautomatorviewer ● Move to Android_SDK/tools/bin, and open uiautomatorviewer ● Click on any UI element you want locator for and you will find all details, pick the resource-id text
  • 30. ● You can use el instance perform various actions like click, type etc. ● el.click(); will click on element ● el.sendKeys("Test"); will type ‘Test’ on field ● el.getText()will return the text of element. You can learn about webelement class here. 4) Perform an action on the Element
  • 31. While using Appium(Selenium) for automated testing of web/mobile applications, we need to add validations in our tests to report them as pass or fail. And assertions can let us do that within a single line of code. Main goal of Test Case is to compare Actual value with Expected Value. We Call this Assertions. For Assertions we need to use external libraries like TestNG or JUnit There are primarily 2 types of Assertions we can make on Element(For UI Testing) 1) Compare the Text values of elements and verify the result 2) Verify whether expected element is present on UI If you are using TestNG then there are two types of assertions. Hard and Soft assert, you can learn it here. 5) Anticipate the Application response
  • 32. 6) Run Tests ● Make Test cases using @Test annotation ● Write the test case code and put assertions ● Select Test case name and do right click then do click on option Run ‘test case name’ ● It will execute the test case and meantime you can see the logs for details. You can also put debug points between your code. ● At last build result and report will be generated.
  • 33. After test case execution build results and log will be generated, using it you will get to know that which test cases have been passed or failed. If your test case has failed then there can be 2 reason: 1) Problem with the code of Test Case 2) New changes introduced in app From the analysis of the log and deep debugging you will get to know the exact root cause of failure and you should fix that. 7) Conclude the test
  • 34. Import my Project There is a sample project on Github, you can import it, change some configuration and run: ◆ Download Project ◆ Connect Android device with PC properly ◆ Import project in IntelliJ ● Click on Import Project ● Select build.gradle file and click Next ● Make sure ‘Use default gradle wrapper’ & Gradle JVM is selected properly. ● Change platform.android.version & device.name in configuration.properties file(according to connected device) ● Run test cases from TestCases.java file Other similar project
  • 35. Why Appium is Best? As you can see, Appium has far more advantages than do the other tools available on the market. However, it’s definitely not perfect. Any given instrument has its strong and weak sides, let’s see it in brief in next slides.
  • 36. Pros ● Appium supports Android and iOS platforms. Code, programming languages and user experience remains the same for both. ● Appium doesn’t require any in-app modifications for testing. An application can be tested right after it’s been downloaded and installed on the device. ● SauceLabs, the guys in charge of Appium, specify in creating various well-known open source automation and manual testing solutions. As a result, Appium is frequently updated and each new release includes new useful features and bug fixes. ● This tool allows automating web, native and hybrid applications, while also offering support for various hardware actions. ● Appium supports all Webdriver-compatible programming languages: Java, Objective-C, JavaScript with Node.js, PHP, Python, Ruby, C#, Clojure and Perl.
  • 37. Cons ● Appium doesn’t support image recognition. ● Such hardware actions as swipe and gestures work only in native applications. ● It is impossible to execute parallel iOS tests. If you want to run tests on multiple devices at once, you’d have to do so on the corresponding number of Mac OS PCs, as Macs only allow executing one instance per device. This limitation may cause a lot of problems with Continuous Integration. However, you could easily fix it by executing tests in the SauceLabs’ mobile cloud, which allows running tests on multiple iOS simulators at once. ● It takes a long time to install and setup Appium for both iOS and Android. ● Appium’s got a very weak sort of documentation, which can be a pain for some engineers. `
  • 38. Assumptions Viewer must have basic knowledge of: ● Testing ● Java ● Programming Viewer must have(In order to execute the testcase) ● Connected Android working device with PC