SlideShare a Scribd company logo
1 of 28
Download to read offline
Android Automation Using Robotium
Presenter : Abhishek Swain, Mindfire Solutions
About Me:
Abhishek Swain, Software QA Engineer
Mindfire Solutions
Skills : Robotium , Appium , Selenium WebDriver , Maven , Junit , SQL ....
Certifications : ISTQB Foundation Level, V-Skills Selenium Certified
Connect Me :
Facebook : http://www.facebook.com/jikun55
LinkedIn : http://in.linkedin.com/pub/abhishek-swain/58/8a/829/
Contact Me :
Email : abhishek.swain@mindfiresolutions.com /mfsi.abhishek@gmail.com
Skype: mfsi_abhishekswain
Agenda
 Introduction
 Features of Robotium
 Limitations
 Configurations and Creating a project
 Discussion on project work flow
 Short Demo
Short Introduction
 Open Source Project hosted under Google code
(Source Code : GitHub)
 Founder and Developer : Redas Rana (Jayway)
 Now Project maintained by Robotium Tech
 Basically its a JAVA jar Library containing robust
functions
 User develops automation scripts using JAVA
 Android SDK Library(android.test) provided for
testing is used with Robotium
What We can do with Robotium:
Features List:
 Can write Automation scripts for Native as well as
Hybrid android applications
 Supports Activities, Native Views, Web Views,
Toasts and Almost all UI Elements
 Can test against Emulators as well as real devices
 One script for all versions of Android 
 Independent of Device screen resolution and Size 
 Not co-ordinate based, so Robust
 Multiple Activities handled automatically
Limitations : 
 No other Client Library supported except Java
 No Support for Flash
Do we need Source Code ??
 Automation Scripts can be written without source
code – Complete support for Blackbox Testing
 We need the installer build of android platform
  i.e apk file
 Can also be written if we have Source code – Hence
supports Whitebox Testing
Requirements :
 Android SDK  
 Download Link: http://developer.android.com/sdk/index.html
 Java JDK
 Eclipse
 Maven
 Maven Plugin for Eclipse
        Installation Link :http://download.eclipse.org/technology/m2e/releases
Installations: 
Requirements :
 JAVA_HOME
 Path of 'bin' directory in System path
 ANDROID_HOME
Path of 'Tools' & 'Platform-Tools' in System Path
 MAVEN_HOME
Path of 'bin' directory in System path
Configurations/Environment Variables: 
Creating Emulators & Configuring Real
Device
 Emulator: 
1. Can be created from 'Android Virtual Device Manager' that is a part Android
SDK
2. Can also be created from command line after necessary path settings
 Real Devices:
1. Enable USB Debugging from settings in device
2. Connect using micro/mini USB Cable with PC
3. Install necessary drivers for USB debugging according to device manufacturer
Re-Signing APK
 Signature of both AUT and Test project must match,
so Re-Signing necessary
 Unsign .apk
 Re-sign it with debug.keystore
Command : jarsigner -verbose -sigalg MD5withRSA
-digestalg SHA1 -keystore debug.keystore
[AUT_name].apk androiddebugkey
Default Password: android
 Resign Jar Tool can also be used
Installing app to Emulators/Device &
Some basic commands 
 Check for connected/available devices
adb devices
 Install app to Device/Emulator
adb install [AUT_name].apk
 Uninstall app
adb uninstall [application package name]
 copy file from PC to Device/Emulator
adb push [file_path]/[File_name_with_extension]
 copy file from Device/Emulator to PC
adb pull [file_path_on_device]/[File_name_with_extension] [folder_path_PC]
Creating Android Test Project
 Create a new Android Test Project from Eclipse
File --> New --> Android Test Project
 Convert it to a Maven Project
 Add the following Dependency of Robotium to pom.xml
       <dependency>
            <groupId>com.jayway.android.robotium</groupId>
            <artifactId>robotium-solo</artifactId>
            <version>5.0.1</version>
        </dependency>
Configuring Android Test Project
 Define Target Package in AndroidManifest.xml
 How to get Activity class names of AUT ?
From Hierarchy Viewer
From Dev Tools - Package Explorer
From Logcat
Developing Test Script :
 Inherit ActivityInstrumentationTestCase2 in the
TestClass
public Class TestClass_Name extends
ActivityInstrumentationTestCase2
Continued..
Developing Test Script :
 Create instance of Solo class
 Define launcher activity class name
 Define setUp() and tearDown() methods
 Define test methods
Understanding Workflow of Android Test
Project
 Based on Junit - Android Junit Test is the customized version of Junit3
 Methods :
setUp() and tearDown()
 Test Function Naming Convention
Must start with keyword 'test' e.g testLogin()
 What happens while Executing :
Two apk files gets installed : AUT apk and Test Project apk
How Android Junit3 Different from
Junit4
 setUp() and tearDown() take the roles of @Before and @After of
Junit4
 Test Function Naming Convention
Must start with keyword 'test' e.g testLogin()
 With Junit4 methods annoted with @Test recognized as test
methods
Annotations Available with Android Junit
Test Project
 Most Frequently Used Annotations:
@Smoke
@SmallTest
@MediumTest
@LargeTest
@FlakyTest(tolerance=n)
 To execute a particular Group of test methods annotations are useful
 Can be specified while running test from Eclipse and command line
How to Target Elements on Activity
 By Index
e.g solo.enterText(0,"some text");
 By Id
e.g solo.getView("Id_Of_Element");
solo.enterText((EdiText)solo.getView("Id_Of_Element")," some text");
How To Get Ids ??
 If we have Source code of AUT, Ids can be
identified from code
 If we don't have Source Code, Hierarchy Viewer can
be used which Comes with Android SDK
Robotium Classes and API Definitions
 Classes:
By
Condition
RobotiumUtils
Solo
Solo.Config
Solo.Config.ScreenshotFileType
Timeout
WebElement
 API Documentation Link:
http://robotium.googlecode.com/svn/doc/index.html
Modes Of Running Tests
 From Eclipse : As Android Junit Test
Annotations, Target Devices can be mentioned in Run Configurations
 From CommandLine: 
adb shell am instrument -w -e size [small/Medium/Large]
Testprojectpackagename/android.test.InstrumentationTestRunner
 
Particular Classes or Particular Functions can also be specified from command
Line
 adb shell am instrument -w  -e class
[class_name_with_package] Testprojectpackagename/android.test.Instrumen
tationTestRunner
Support For Build Tools and CI
Integration Servers
 Can be used with Build Tools like Maven , Ant etc
 Android-Maven-Plugin is used to Build with Maven
 Can be integrated with Continuous Integration (CI)
server like Jenkins/Hudson
Demo : 
Questions ?? 
www.mindfiresolutions.com
https://www.facebook.com/MindfireSolutions
http://www.linkedin.com/company/mindfire-solutions
http://twitter.com/mindfires

More Related Content

What's hot

Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Bitbar
 
Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021Svetlin Nakov
 
Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Daniel Knott
 
Testing on Android
Testing on AndroidTesting on Android
Testing on AndroidAri Lacenski
 
Unit testing and Android
Unit testing and AndroidUnit testing and Android
Unit testing and AndroidTomáš Kypta
 
MonkeyTalk Automation Testing For Android Application
MonkeyTalk Automation Testing For Android ApplicationMonkeyTalk Automation Testing For Android Application
MonkeyTalk Automation Testing For Android ApplicationContusQA
 
A guide to Android automated testing
A guide to Android automated testingA guide to Android automated testing
A guide to Android automated testingjotaemepereira
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation toolsSSGMCE SHEGAON
 
MonkeyTalk Documentation
MonkeyTalk DocumentationMonkeyTalk Documentation
MonkeyTalk DocumentationVivek Pansara
 
Mobile Application Test automation using MonkeyTalk Tool
Mobile Application Test automation using MonkeyTalk ToolMobile Application Test automation using MonkeyTalk Tool
Mobile Application Test automation using MonkeyTalk ToolVivek Pansara
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersAjit Jadhav
 
Utilizando Espresso e UIAutomator no Teste de Apps Android
Utilizando Espresso e UIAutomator no Teste de Apps AndroidUtilizando Espresso e UIAutomator no Teste de Apps Android
Utilizando Espresso e UIAutomator no Teste de Apps AndroidEduardo Carrara de Araujo
 
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 appiumAmbreen Khan
 
Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)Sauce Labs
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 

What's hot (20)

Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 
Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021
 
Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012
 
Testing on Android
Testing on AndroidTesting on Android
Testing on Android
 
Unit testing and Android
Unit testing and AndroidUnit testing and Android
Unit testing and Android
 
Android Test Automation Workshop
Android Test Automation WorkshopAndroid Test Automation Workshop
Android Test Automation Workshop
 
Automated UI Testing Frameworks
Automated UI Testing FrameworksAutomated UI Testing Frameworks
Automated UI Testing Frameworks
 
MonkeyTalk Automation Testing For Android Application
MonkeyTalk Automation Testing For Android ApplicationMonkeyTalk Automation Testing For Android Application
MonkeyTalk Automation Testing For Android Application
 
A guide to Android automated testing
A guide to Android automated testingA guide to Android automated testing
A guide to Android automated testing
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation tools
 
MonkeyTalk Documentation
MonkeyTalk DocumentationMonkeyTalk Documentation
MonkeyTalk Documentation
 
Appium & Jenkins
Appium & JenkinsAppium & Jenkins
Appium & Jenkins
 
BCS Selenium Workshop
BCS Selenium WorkshopBCS Selenium Workshop
BCS Selenium Workshop
 
Monkey talk
Monkey talkMonkey talk
Monkey talk
 
Mobile Application Test automation using MonkeyTalk Tool
Mobile Application Test automation using MonkeyTalk ToolMobile Application Test automation using MonkeyTalk Tool
Mobile Application Test automation using MonkeyTalk Tool
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
Utilizando Espresso e UIAutomator no Teste de Apps Android
Utilizando Espresso e UIAutomator no Teste de Apps AndroidUtilizando Espresso e UIAutomator no Teste de Apps Android
Utilizando Espresso e UIAutomator no Teste de Apps Android
 
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
 
Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 

Similar to Android Automation Using Robotium

Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appiumPratik Patel
 
Appium understanding document
Appium understanding documentAppium understanding document
Appium understanding documentAkshay Pillay
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using AppiumMindfire Solutions
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxlancelotlaytan1996
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guidemagicshui
 
automation framework
automation frameworkautomation framework
automation frameworkANSHU GOYAL
 
Testing in Android: automatici, di integrazione, TDD e scenari avanzati
Testing in Android: automatici, di integrazione, TDD e scenari avanzatiTesting in Android: automatici, di integrazione, TDD e scenari avanzati
Testing in Android: automatici, di integrazione, TDD e scenari avanzatiAlfredo Morresi
 
Android Workshop
Android WorkshopAndroid Workshop
Android WorkshopJunda Ong
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studioParinita03
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
Final NEWS.pdf
Final NEWS.pdfFinal NEWS.pdf
Final NEWS.pdfRebaMaheen
 
Final NewsApp.pdf
Final NewsApp.pdfFinal NewsApp.pdf
Final NewsApp.pdfRebaMaheen
 

Similar to Android Automation Using Robotium (20)

Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Appium
AppiumAppium
Appium
 
Appium understanding document
Appium understanding documentAppium understanding document
Appium understanding document
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guide
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
automation framework
automation frameworkautomation framework
automation framework
 
Testing in Android: automatici, di integrazione, TDD e scenari avanzati
Testing in Android: automatici, di integrazione, TDD e scenari avanzatiTesting in Android: automatici, di integrazione, TDD e scenari avanzati
Testing in Android: automatici, di integrazione, TDD e scenari avanzati
 
Android Development
Android DevelopmentAndroid Development
Android Development
 
Appium- part 1
Appium- part 1Appium- part 1
Appium- part 1
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Appium
AppiumAppium
Appium
 
Android tutorial1
Android tutorial1Android tutorial1
Android tutorial1
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Final NEWS.pdf
Final NEWS.pdfFinal NEWS.pdf
Final NEWS.pdf
 
Final NewsApp.pdf
Final NewsApp.pdfFinal NewsApp.pdf
Final NewsApp.pdf
 
Appium solution artizone
Appium solution   artizoneAppium solution   artizone
Appium solution artizone
 

More from Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Recently uploaded

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 

Recently uploaded (20)

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 

Android Automation Using Robotium

  • 1. Android Automation Using Robotium Presenter : Abhishek Swain, Mindfire Solutions
  • 2. About Me: Abhishek Swain, Software QA Engineer Mindfire Solutions Skills : Robotium , Appium , Selenium WebDriver , Maven , Junit , SQL .... Certifications : ISTQB Foundation Level, V-Skills Selenium Certified Connect Me : Facebook : http://www.facebook.com/jikun55 LinkedIn : http://in.linkedin.com/pub/abhishek-swain/58/8a/829/ Contact Me : Email : abhishek.swain@mindfiresolutions.com /mfsi.abhishek@gmail.com Skype: mfsi_abhishekswain
  • 3. Agenda  Introduction  Features of Robotium  Limitations  Configurations and Creating a project  Discussion on project work flow  Short Demo
  • 4. Short Introduction  Open Source Project hosted under Google code (Source Code : GitHub)  Founder and Developer : Redas Rana (Jayway)  Now Project maintained by Robotium Tech  Basically its a JAVA jar Library containing robust functions  User develops automation scripts using JAVA  Android SDK Library(android.test) provided for testing is used with Robotium
  • 5. What We can do with Robotium: Features List:  Can write Automation scripts for Native as well as Hybrid android applications  Supports Activities, Native Views, Web Views, Toasts and Almost all UI Elements  Can test against Emulators as well as real devices  One script for all versions of Android   Independent of Device screen resolution and Size   Not co-ordinate based, so Robust  Multiple Activities handled automatically
  • 6. Limitations :   No other Client Library supported except Java  No Support for Flash
  • 7. Do we need Source Code ??  Automation Scripts can be written without source code – Complete support for Blackbox Testing  We need the installer build of android platform   i.e apk file  Can also be written if we have Source code – Hence supports Whitebox Testing
  • 8. Requirements :  Android SDK    Download Link: http://developer.android.com/sdk/index.html  Java JDK  Eclipse  Maven  Maven Plugin for Eclipse         Installation Link :http://download.eclipse.org/technology/m2e/releases Installations: 
  • 9. Requirements :  JAVA_HOME  Path of 'bin' directory in System path  ANDROID_HOME Path of 'Tools' & 'Platform-Tools' in System Path  MAVEN_HOME Path of 'bin' directory in System path Configurations/Environment Variables: 
  • 10. Creating Emulators & Configuring Real Device  Emulator:  1. Can be created from 'Android Virtual Device Manager' that is a part Android SDK 2. Can also be created from command line after necessary path settings  Real Devices: 1. Enable USB Debugging from settings in device 2. Connect using micro/mini USB Cable with PC 3. Install necessary drivers for USB debugging according to device manufacturer
  • 11. Re-Signing APK  Signature of both AUT and Test project must match, so Re-Signing necessary  Unsign .apk  Re-sign it with debug.keystore Command : jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore debug.keystore [AUT_name].apk androiddebugkey Default Password: android  Resign Jar Tool can also be used
  • 12. Installing app to Emulators/Device & Some basic commands   Check for connected/available devices adb devices  Install app to Device/Emulator adb install [AUT_name].apk  Uninstall app adb uninstall [application package name]  copy file from PC to Device/Emulator adb push [file_path]/[File_name_with_extension]  copy file from Device/Emulator to PC adb pull [file_path_on_device]/[File_name_with_extension] [folder_path_PC]
  • 13. Creating Android Test Project  Create a new Android Test Project from Eclipse File --> New --> Android Test Project  Convert it to a Maven Project  Add the following Dependency of Robotium to pom.xml        <dependency>             <groupId>com.jayway.android.robotium</groupId>             <artifactId>robotium-solo</artifactId>             <version>5.0.1</version>         </dependency>
  • 14. Configuring Android Test Project  Define Target Package in AndroidManifest.xml  How to get Activity class names of AUT ? From Hierarchy Viewer From Dev Tools - Package Explorer From Logcat
  • 15. Developing Test Script :  Inherit ActivityInstrumentationTestCase2 in the TestClass public Class TestClass_Name extends ActivityInstrumentationTestCase2 Continued..
  • 16. Developing Test Script :  Create instance of Solo class  Define launcher activity class name  Define setUp() and tearDown() methods  Define test methods
  • 17. Understanding Workflow of Android Test Project  Based on Junit - Android Junit Test is the customized version of Junit3  Methods : setUp() and tearDown()  Test Function Naming Convention Must start with keyword 'test' e.g testLogin()  What happens while Executing : Two apk files gets installed : AUT apk and Test Project apk
  • 18. How Android Junit3 Different from Junit4  setUp() and tearDown() take the roles of @Before and @After of Junit4  Test Function Naming Convention Must start with keyword 'test' e.g testLogin()  With Junit4 methods annoted with @Test recognized as test methods
  • 19. Annotations Available with Android Junit Test Project  Most Frequently Used Annotations: @Smoke @SmallTest @MediumTest @LargeTest @FlakyTest(tolerance=n)  To execute a particular Group of test methods annotations are useful  Can be specified while running test from Eclipse and command line
  • 20. How to Target Elements on Activity  By Index e.g solo.enterText(0,"some text");  By Id e.g solo.getView("Id_Of_Element"); solo.enterText((EdiText)solo.getView("Id_Of_Element")," some text");
  • 21. How To Get Ids ??  If we have Source code of AUT, Ids can be identified from code  If we don't have Source Code, Hierarchy Viewer can be used which Comes with Android SDK
  • 22. Robotium Classes and API Definitions  Classes: By Condition RobotiumUtils Solo Solo.Config Solo.Config.ScreenshotFileType Timeout WebElement  API Documentation Link: http://robotium.googlecode.com/svn/doc/index.html
  • 23. Modes Of Running Tests  From Eclipse : As Android Junit Test Annotations, Target Devices can be mentioned in Run Configurations  From CommandLine:  adb shell am instrument -w -e size [small/Medium/Large] Testprojectpackagename/android.test.InstrumentationTestRunner   Particular Classes or Particular Functions can also be specified from command Line  adb shell am instrument -w  -e class [class_name_with_package] Testprojectpackagename/android.test.Instrumen tationTestRunner
  • 24. Support For Build Tools and CI Integration Servers  Can be used with Build Tools like Maven , Ant etc  Android-Maven-Plugin is used to Build with Maven  Can be integrated with Continuous Integration (CI) server like Jenkins/Hudson
  • 27.