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

PDF
Appium: Automation for Mobile Apps
PPTX
Automation Testing With Appium
PPTX
Appium overview
PPTX
Mobile Automation with Appium
PPTX
Appium Presentation
PPTX
Appium ppt
PDF
Mobile Testing with Appium
PPTX
Automation With Appium
Appium: Automation for Mobile Apps
Automation Testing With Appium
Appium overview
Mobile Automation with Appium
Appium Presentation
Appium ppt
Mobile Testing with Appium
Automation With Appium

What's hot (20)

PPT
Appium
PPT
Android & iOS Automation Using Appium
PDF
Mobile Test Automation - Appium
PDF
Appium basics
PDF
Introduction To Mobile-Automation
PPT
PPTX
Automation testing on ios platform using appium
PDF
What is Appium? Edureka
PPTX
Appium solution
PPTX
Mobile automation using Appium
PPT
Mobile Application Testing Strategy
PDF
Appium Architecture | How Appium Works | Edureka
PPSX
API Test Automation
 
PPTX
Angular Unit Testing
PDF
Automation Testing using Selenium
PDF
Test Automation
PPTX
Test Automation and Selenium
PPTX
Automation Testing with Test Complete
PPT
Ppt of soap ui
PPTX
API Automation Testing Using RestAssured+Cucumber
Appium
Android & iOS Automation Using Appium
Mobile Test Automation - Appium
Appium basics
Introduction To Mobile-Automation
Automation testing on ios platform using appium
What is Appium? Edureka
Appium solution
Mobile automation using Appium
Mobile Application Testing Strategy
Appium Architecture | How Appium Works | Edureka
API Test Automation
 
Angular Unit Testing
Automation Testing using Selenium
Test Automation
Test Automation and Selenium
Automation Testing with Test Complete
Ppt of soap ui
API Automation Testing Using RestAssured+Cucumber
Ad

Similar to Getting started with appium (20)

PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
PDF
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
PDF
Browser_Stack_Intro
PPTX
Dive into Angular, part 5: Experience
PPTX
Using galen framework for automated cross browser layout testing
PDF
Appium- part 1
PDF
Android UI Testing with Appium
PDF
Final NEWS.pdf
PDF
Final NewsApp.pdf
PPTX
Module-I_Introduction-to-Android.pptx
PDF
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
PDF
Getting Started with Android Studio: A Step-by-Step Guide
PDF
Android Automation Using Robotium
PDF
Android programming-basics
PPTX
Appium Meetup #2 - Mobile Web Automation Introduction
PPTX
this is PPT for mobail application development
PDF
AngularJS Project Setup step-by- step guide - RapidValue Solutions
PDF
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
PDF
Appium understanding document
PPTX
How to create android applications
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
Browser_Stack_Intro
Dive into Angular, part 5: Experience
Using galen framework for automated cross browser layout testing
Appium- part 1
Android UI Testing with Appium
Final NEWS.pdf
Final NewsApp.pdf
Module-I_Introduction-to-Android.pptx
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Getting Started with Android Studio: A Step-by-Step Guide
Android Automation Using Robotium
Android programming-basics
Appium Meetup #2 - Mobile Web Automation Introduction
this is PPT for mobail application development
AngularJS Project Setup step-by- step guide - RapidValue Solutions
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Appium understanding document
How to create android applications
Ad

Recently uploaded (20)

PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
history of c programming in notes for students .pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
System and Network Administration Chapter 2
PDF
medical staffing services at VALiNTRY
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
L1 - Introduction to python Backend.pptx
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
top salesforce developer skills in 2025.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Nekopoi APK 2025 free lastest update
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Online Work Permit System for Fast Permit Processing
PPT
Introduction Database Management System for Course Database
Navsoft: AI-Powered Business Solutions & Custom Software Development
history of c programming in notes for students .pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
Wondershare Filmora 15 Crack With Activation Key [2025
CHAPTER 2 - PM Management and IT Context
Which alternative to Crystal Reports is best for small or large businesses.pdf
System and Network Administration Chapter 2
medical staffing services at VALiNTRY
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
L1 - Introduction to python Backend.pptx
Odoo Companies in India – Driving Business Transformation.pdf
top salesforce developer skills in 2025.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Transform Your Business with a Software ERP System
Design an Analysis of Algorithms II-SECS-1021-03
Nekopoi APK 2025 free lastest update
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Online Work Permit System for Fast Permit Processing
Introduction Database Management System for Course Database

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