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

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
 

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

Android installation guide
Android installation guideAndroid installation guide
Android installation guide
magicshui
 
automation framework
automation frameworkautomation framework
automation framework
ANSHU 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 avanzati
Alfredo Morresi
 

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

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

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 

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.