SlideShare a Scribd company logo
Robotium Tutorial


                                    Mobile March
                                   March 21, 2013

                                           An Intertech Course




                    By Jim White, Intertech, Inc..
Course Name




                                                                         Stop by Intertech’s
                                                                         booth for a chance to
                                                                         win FREE Training.

       Or go to bit.ly.com/intertech-login

   Slides & demo code available at intertech.com/blog
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 2
Course Name




   Session Agenda
   • Robotium…
           •    What is it?
           •    Where to get it and how to set it up
           •    “Normal” Android unit testing background
           •    Why Robotium is needed
           •    Using Robotium
           •    Robotium Tips/Tricks/Issues
           •    Complimentary tools
           •    Further Resources
           •    Q&A




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 3
Course Name




   Purpose
   • The main point/purpose to my talk…
           • There are wonderful test/QA tools available for Android!
           • There are no excuses for skipping unit testing in Android!




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 4
Course Name




   Jim White Intro
   • Intertech Partner,
           • Dir. of Training,
           • Instructor,
           • Consultant
   • Co-author, J2ME, Java in Small
     Things (Manning)
           • Device developer since before
             phones were “smart”
           • Java developer when “spring”
             and “struts” described your
             stride
   • Occasional beer drinker


Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 5
Course Name




   Robotium – what is it?
   • An open source test framework
   • Used to write black or white box tests (emphasis is on black box)
           • White box testing – testing software that knows and tests the internal
             structures or workings of an application
           • Black box testing – testing software functionality without knowledge of
             an application (perhaps where the source code is not even available)
   • Tests can be executed on an Android Virtual Device (AVD) or real
     device
   • Built on Java (and Android) and JUnit (the Android Test Framework)
           • In fact, it may be more appropriate to call Robotium an extension to the
             Android test framework



Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 6
Course Name




   Robotium Project Setup
   • Prerequisites
           • Install and setup JDK
           • Install and setup Eclipse (optional)
           • Install and setup Android Standard Development Kit (SDK)
                   • Supports Android 1.6 (API level 4) and above
           • Install and setup Android Development Tools (ADT) for Eclipse (optional)
           • Create Android AVD or attach device by USB
   • Create an Android Test Project
   • Download Robotium JAR and add to project classpath
           • robotium-solo-X.X.jar (version 3.6 the latest as of this writing)
           • From code.google.com/p/robotium/downloads/list



Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 7
Course Name




   Background - Android JUnit Testing
   • Android testing is based on JUnit
           • You create test suites, classes (test cases), methods
           • Organize tests into a Android Test project
           • Android API supports JUnit 3 code style – not JUnit 4!
                   • No annotations
                   • Old JUnit naming conventions
   • Test case classes can extend good-old-fashion JUnit3 TestCase
           • To call Android APIs, base class must extend AndroidTestCase
           • Use JUnit Assert class to check/display test results
   • Execute tests using an SDK provided InstrumentationTestRunner
           • android.test.InstrumentationTestRunner
           • Usually handled automatically via IDE


Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 8
Course Name




   Android Test Architecture
   • Architecturally, the unit testing project and app project run on the
     same JVM (i.e. DVM).




                                                                         Test case classes,
                                                                         instrumentation, JUnit,
                                                                         mock objects, etc.


Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 9
Course Name




   Robotium Project Setup
   • Add Robotium JAR to the Java                                         • Put Robotium in the build path
     Build Path                                                             order.




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 10
Course Name




   Android JUnit Project Setup




                                                       Demo



Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 11
Course Name




   The “App” Used To Demo Today
   • Want to make sure data is
     entered.
   • Want to make sure data is
     valid.
           • Age is less than 122
           • Zip has 5 characters
   • Make sure a role is clicked.
   • Make sure clear does clear the
     fields.
   • Etc.




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 12
Course Name




   Example JUnit Test (Continued)
   public class TestDataCollection extends ActivityInstrumentationTestCase2<DataCollectionActivity> {

    DataCollectionActivity activity;

    public TestDataCollection() {                                               Extends AndroidTestCase –
      super(DataCollectionActivity.class);                                      provides functionality for testing a
                                                                                single Activity. Need to associate it
    }
                                                                                to an Activity type (like
                                                                                DataCollectionActivity)
    @Override
    public void setUp() throws Exception {
      super.setUp();                                                      Test case initialization method (just
      activity = getActivity();                                           like JUnit 3).
    }

    @Override
    protected void tearDown() throws Exception {
       activity.finish();                                                           Test case tear down method (just
       super.tearDown();                                                            like JUnit 3).
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 13
    }
Course Name




   Example JUnit Test (Continued)                                                 Test methods must
                                                                                  begin with “test”.
        public void testCheckNameClear() {
         final EditText name = (EditText) activity.findViewById(R.id.nameEdit);
         activity.runOnUiThread(new Runnable() {                                    Grab widgets by
            public void run() {                                                     their Android ID.
              name.requestFocus();              UI adjustments/ work must
            }                                   be done on UI thread
         });
         sendKeys("J I M");
                                                                                             TestCase,
                                                                                             TouchUtils
         Button button = (Button) activity.findViewById(R.id.clearButton);
                                                                                             provide limited UI
         TouchUtils.clickView(this, button);
                                                                                             maneuvering, but
         assertTrue("First name field is not empty.", name.getText().toString().equals(""));
                                                                                             again requires
       }
                                                                                          deep knowledge
   }
                                                                                          of the UI details


                                             Normal assert methods to
                                             check results.
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 14
Course Name




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 15
Course Name




   Why Android JUnit Isn’t Enough
   •     Requires deep knowledge of widgets
           •    Widget IDs
           •    Widget Properties
           •    What has focus
           •    Order of widgets
           •    Etc.
   •     Often requires deep knowledge of Android internals
           •    Especially around menus, dialogs, etc.
   •     Makes for brittle unit tests
           •    As the UI changes, the test often must change dramatically.
   •     Poor instrumentation
           •    Instrumentation is a feature in which specific monitoring of the interactions
                between an application and the system are made possible.
           •    Use of runOnUIThread to execute UI work that isn’t covered by TouchUtils or
                TestCase class.
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 16
Course Name




   Example Robotium
   • Use Robotium tests in JUnit test class
           • Same code as in TestDataCollectionActivity above…
           • With a few additions/changes.




           private Solo solo;

           @Override
                                                                          Add a Solo member
           public void setUp() throws Exception {                         variable and initialize it
             super.setUp();                                               during setUp( ).
             activity = getActivity();
             solo= new Solo(getInstrumentation(), getActivity());
           }



Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 17
Course Name




   Example Robotium (Continued)
   • The new test method – greatly simplified via Robotium!

      public void testCheckNameClear() {
        solo.enterText(0, "Jim");                    // 0 is the index of the EditText field
        solo.clickOnButton("Clear");
        assertTrue("First name field is not empty.",solo.getEditText(0).
         getText().toString().equals(""));
      }


                                                                            Solo methods allow
                                                                            widgets to be selected
                                                                            and interacted with.




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 18
Course Name




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 19
Course Name




   Robotium Solo API
   • Robotium is all baked into one class - Solo – with many methods:
           • clickX methods: clickOnButton, clickOnImage, clickOnText,…
           • clickLongX methods: clickLongInList, clickLongOnScreen,
             clickLongOnText,…
           • enterText
           • drag
           • getX methods: getButton, getCurrentActivity, getImage, getEditText, …
           • goBack
           • isX methods: isCheckBoxChecked, isRadioButtonChecked,
             isSpinnerTextSelected, isTextChecked,…
           • pressX methods: pressMenuItem, pressMenuItem, pressSpinnerItem, …
           • scrollX methods: scrollToTop, scrollToBottom, …
           • searchX methods: searchButton, searchEditText, searchText, …
           • waitForX methods: waitForActivity, waitForText, …
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 20
Course Name




   Android Robotium Demo




                                                       Demo



Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 21
Course Name




   Tips & Tricks
   • Robotium (and all JUnit tests) operate in the same process (DVM) as
     the original app
           • Robotium only works with the activities and views within the defined app
           • For example: Can’t use intent to launch another app and test activity
             work from that app
   • The popup keyboard is accomplished with a bitmap in Android
           • Robotium (or any unit test software) doesn’t see the “keys” as buttons or
             anything.




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 22
Course Name




   Tips & Tricks (Continued)
   • Use waitFor methods liberally.
           • Especially if new screen opens or changes to what is displayed are
             occurring.
           • The waitFor methods tell Robotium to wait for a condition to happen
             before the execution continues.
           public void testGoodLogin() {
                    solo.enterText(0, “username");
                    solo.enterText(1, “password");
                    String label = res.getString(R.string.login_button_label);
                    solo.clickOnButton(label);
                    String title = res.getString(R.string.title_activity_systemv);
                    solo.waitForText(title);
                    solo.assertCurrentActivity("systemv", SystemVActivity.class);
                    solo.getCurrentActivity().finish();
           }
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 23
Course Name




   Tips & Tricks (Continued)
   • RadioButtons are Buttons, EditText are Text, etc…
           • Getting the proper widget by index can be more difficult
           • Use of index also makes the test case more brittle due to potential layout
             changes
           • Consider clickOnButton(“Clear”) vs.
               clickOnButton(6)




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 24
Course Name




   Tips & Tricks (Continued)
   • Resources in Android are at a premium (especially when test cases
     and App code are running in same DVM).
           • Use solo.finishOpenedActivities() in your tearDown method.
           • It closes all the opened activities.
           • Frees resources for the next tests
   • Robotium has some difficulty with animations
   • Robotium doesn’t work with status bar notifications




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 25
Course Name




   Tips & Tricks – Black Box Testing
   • Black Box Testing (when all you have is the APK file) is a little more
     tricky.
           • Recall in the demo, the test application wants the main activity name?
                                  public TestDataCollectionActivity() {
                                              super(DataCollectionActivity.class);
                                  }
           • You may not know this for a 3rd party/black box app.
           • You can get the activity name by loading the APK to an AVD or device,
             running it, and watching the logcat.
   • The APK file has to have the same certificate signature as the test
     project.
           • Probably have to delete the signature and then resign the APK with the
             Android debug key signature.
           • It’s easier than it sounds. See referenced document for help.
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 26
Course Name




   Android Robotium Black Box Demo




                                                Black Box
                                                  Demo



Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 27
Course Name




   Robotium Additional Features
   • Robotium can automatically take screenshots
           • solo.takeScreenshot( )
   • Robotium can be run from the command line (using adb shell)
           • adb shell am instrument -w
             com.android.foo/android.test.InstrumentationTestRunner
   • Robotium can test with localized strings
           • solo.getString(localized_resource_string_id)
   • Code coverage is a bit lackluster at this time
           • Can be done with special ant task and command line tools
   • Robotium does not work on Flash or Web apps.



Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 28
Course Name




   Complimentary Tools
   • Robotium Testroid Recorder
           •    Record actions to generate Android JUnit/Robotium test cases
           •    Run tests on 180 devices “in the cloud”
           •    Testdroid.com
           •    Commercial product (50 runs free, $99/month or ¢99/run)


   • Robotium Remote Control
           • Allows Robotium test cases to be executed from the JVM (on a PC)
                   • This allows Robotium to work with JUnit 4.
           • code.google.com/p/robotium/wiki/RemoteControl




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 29
Course Name




   Resources
   • These slides and demo code: intertech.com/blog
   • Google Robotium site
           • code.google.com/p/robotium
           • code.google.com/p/robotium/wiki/RobotiumTutorials
   • Tutorial Articles/Blog Posts
           •    devblog.xing.com/qa/robotium-atxing/
           •    www.netmagazine.com/tutorials/automate-your-android-app-testing
           •    robotiumsolo.blogspot.com/2012/12/what-is-robotium.html
           •    www.vogella.com/articles/AndroidTesting/article.html
           •    robotium.googlecode.com/files/RobotiumForBeginners.pdf
                   • excellent article for black box testing when all you have is the APK
   • Fundamentals of Android Unit Testing
           • developer.android.com/tools/testing/testing_android.html
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 30
Course Name




   Q&A
          • Questions – you got’em, I want’em




Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 31
Course Name




     Award-Winning Training and Consulting.




                  Visit     www.Intertech.com for complete details.
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 32
Course Name




     Intertech offers
     Mobile Training On:
                                 •     Android
                                 •     HTML5
                                 •     iOS
                                 •     Java ME
                                 •     jQuery
                                 •     Windows Phone




         Visit    ww.Intertech.com for complete course schedule.
Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 33
Course Name




                                                                      Stop by Intertech’s
                                                                      booth for a chance to
                                                                      win FREE Training.


          Or go to bit.ly.com/intertech-login

Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 34

More Related Content

What's hot

Appium basics
Appium basicsAppium basics
Appium basics
Syam Sasi
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
shreyas JC
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
Pratik Patel
 
Automation using Appium
Automation using AppiumAutomation using Appium
Automation using Appium
Livares Technologies Pvt Ltd
 
Joomla REST API
Joomla REST APIJoomla REST API
Joomla REST API
Ashwin Date
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
Khaja Moiz Uddin
 
Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation
OmarUsman6
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With Appium
Knoldus Inc.
 
The history of selenium
The history of seleniumThe history of selenium
The history of selenium
Arun Motoori
 
Android Automation Testing with Selendroid
Android Automation Testing with SelendroidAndroid Automation Testing with Selendroid
Android Automation Testing with Selendroid
Vikas Thange
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Naga Dinesh
 
Swagger pour documenter votre REST API - présentation en français
Swagger pour documenter votre REST API - présentation en françaisSwagger pour documenter votre REST API - présentation en français
Swagger pour documenter votre REST API - présentation en français
Martin Yung
 
Using API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonyconUsing API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonycon
Antonio Peric-Mazar
 
Clean code
Clean codeClean code
Clean code
Bulat Shakirzyanov
 
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
Ajit Jadhav
 
Automação de testes de API utilizando Postman
Automação de testes de API utilizando PostmanAutomação de testes de API utilizando Postman
Automação de testes de API utilizando Postman
Lucas Amaral
 
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
TestComplete – A Sophisticated Automated Testing Tool by SmartBearTestComplete – A Sophisticated Automated Testing Tool by SmartBear
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
Software Testing Solution
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And MockingJoe Wilson
 

What's hot (20)

Appium basics
Appium basicsAppium basics
Appium basics
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Test studio
Test studioTest studio
Test studio
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Automation using Appium
Automation using AppiumAutomation using Appium
Automation using Appium
 
Joomla REST API
Joomla REST APIJoomla REST API
Joomla REST API
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
 
Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With Appium
 
The history of selenium
The history of seleniumThe history of selenium
The history of selenium
 
Android Automation Testing with Selendroid
Android Automation Testing with SelendroidAndroid Automation Testing with Selendroid
Android Automation Testing with Selendroid
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium Concepts
Selenium ConceptsSelenium Concepts
Selenium Concepts
 
Swagger pour documenter votre REST API - présentation en français
Swagger pour documenter votre REST API - présentation en françaisSwagger pour documenter votre REST API - présentation en français
Swagger pour documenter votre REST API - présentation en français
 
Using API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonyconUsing API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonycon
 
Clean code
Clean codeClean code
Clean code
 
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
 
Automação de testes de API utilizando Postman
Automação de testes de API utilizando PostmanAutomação de testes de API utilizando Postman
Automação de testes de API utilizando Postman
 
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
TestComplete – A Sophisticated Automated Testing Tool by SmartBearTestComplete – A Sophisticated Automated Testing Tool by SmartBear
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 

Similar to Robotium Tutorial

Introduction to Robotium
Introduction to RobotiumIntroduction to Robotium
Introduction to Robotiumalii abbb
 
Guide to the jungle of testing frameworks
Guide to the jungle of testing frameworksGuide to the jungle of testing frameworks
Guide to the jungle of testing frameworks
Tomáš Kypta
 
Alexey Buzdin "Maslow's Pyramid of Android Testing"
Alexey Buzdin "Maslow's Pyramid of Android Testing"Alexey Buzdin "Maslow's Pyramid of Android Testing"
Alexey Buzdin "Maslow's Pyramid of Android Testing"
IT Event
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
solit
 
An Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDDAn Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDD
Ahmed Ehab AbdulAziz
 
Robotium framework & Jenkins CI tools - TdT@Cluj #19
Robotium framework & Jenkins CI tools - TdT@Cluj #19Robotium framework & Jenkins CI tools - TdT@Cluj #19
Robotium framework & Jenkins CI tools - TdT@Cluj #19
Tabăra de Testare
 
少し幸せになる技術
少し幸せになる技術少し幸せになる技術
少し幸せになる技術
kamedon39
 
Need(le) for Speed - Effective Unit Testing for Java EE
Need(le) for Speed - Effective Unit Testing for Java EENeed(le) for Speed - Effective Unit Testing for Java EE
Need(le) for Speed - Effective Unit Testing for Java EE
hwilming
 
Utilizando expresso uiautomator na automacao de testes em apps android
Utilizando expresso uiautomator na automacao de testes em apps androidUtilizando expresso uiautomator na automacao de testes em apps android
Utilizando expresso uiautomator na automacao de testes em apps android
tdc-globalcode
 
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
Eduardo Carrara de Araujo
 
31b - JUnit and Mockito.pdf
31b - JUnit and Mockito.pdf31b - JUnit and Mockito.pdf
31b - JUnit and Mockito.pdf
gauravavam
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Stanislav Tiurikov
 
Tdd & unit test
Tdd & unit testTdd & unit test
Tdd & unit test
GomathiNayagam S
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
Mats Bryntse
 
Robotium - sampath
Robotium - sampathRobotium - sampath
Robotium - sampath
Sampath Muddineni
 
Junit mockito and PowerMock in Java
Junit mockito and  PowerMock in JavaJunit mockito and  PowerMock in Java
Junit mockito and PowerMock in Java
Ankur Maheshwari
 
Android Workshop 2013
Android Workshop 2013Android Workshop 2013
Android Workshop 2013
Junda Ong
 
Junit_.pptx
Junit_.pptxJunit_.pptx
Junit_.pptx
Suman Sourav
 
Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015
Buşra Deniz, CSM
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
javatwo2011
 

Similar to Robotium Tutorial (20)

Introduction to Robotium
Introduction to RobotiumIntroduction to Robotium
Introduction to Robotium
 
Guide to the jungle of testing frameworks
Guide to the jungle of testing frameworksGuide to the jungle of testing frameworks
Guide to the jungle of testing frameworks
 
Alexey Buzdin "Maslow's Pyramid of Android Testing"
Alexey Buzdin "Maslow's Pyramid of Android Testing"Alexey Buzdin "Maslow's Pyramid of Android Testing"
Alexey Buzdin "Maslow's Pyramid of Android Testing"
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
 
An Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDDAn Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDD
 
Robotium framework & Jenkins CI tools - TdT@Cluj #19
Robotium framework & Jenkins CI tools - TdT@Cluj #19Robotium framework & Jenkins CI tools - TdT@Cluj #19
Robotium framework & Jenkins CI tools - TdT@Cluj #19
 
少し幸せになる技術
少し幸せになる技術少し幸せになる技術
少し幸せになる技術
 
Need(le) for Speed - Effective Unit Testing for Java EE
Need(le) for Speed - Effective Unit Testing for Java EENeed(le) for Speed - Effective Unit Testing for Java EE
Need(le) for Speed - Effective Unit Testing for Java EE
 
Utilizando expresso uiautomator na automacao de testes em apps android
Utilizando expresso uiautomator na automacao de testes em apps androidUtilizando expresso uiautomator na automacao de testes em apps android
Utilizando expresso uiautomator na automacao de testes em apps android
 
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
 
31b - JUnit and Mockito.pdf
31b - JUnit and Mockito.pdf31b - JUnit and Mockito.pdf
31b - JUnit and Mockito.pdf
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Tdd & unit test
Tdd & unit testTdd & unit test
Tdd & unit test
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
Robotium - sampath
Robotium - sampathRobotium - sampath
Robotium - sampath
 
Junit mockito and PowerMock in Java
Junit mockito and  PowerMock in JavaJunit mockito and  PowerMock in Java
Junit mockito and PowerMock in Java
 
Android Workshop 2013
Android Workshop 2013Android Workshop 2013
Android Workshop 2013
 
Junit_.pptx
Junit_.pptxJunit_.pptx
Junit_.pptx
 
Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 

More from Mobile March

Cross-Platform Mobile Development with PhoneGap-Vince Bullinger
Cross-Platform Mobile Development with PhoneGap-Vince BullingerCross-Platform Mobile Development with PhoneGap-Vince Bullinger
Cross-Platform Mobile Development with PhoneGap-Vince Bullinger
Mobile March
 
You Can’t Ignore the Tablet-Designing & Developing Universal Apps for Phones ...
You Can’t Ignore the Tablet-Designing & Developing Universal Apps for Phones ...You Can’t Ignore the Tablet-Designing & Developing Universal Apps for Phones ...
You Can’t Ignore the Tablet-Designing & Developing Universal Apps for Phones ...
Mobile March
 
Building Wearables-Kristina Durivage
Building Wearables-Kristina DurivageBuilding Wearables-Kristina Durivage
Building Wearables-Kristina Durivage
Mobile March
 
The Blossoming Internet of Things Zach Supalla-Spark
The Blossoming Internet of Things Zach Supalla-SparkThe Blossoming Internet of Things Zach Supalla-Spark
The Blossoming Internet of Things Zach Supalla-Spark
Mobile March
 
LiveCode Cross-Platform Development-Joel Gerdeen
LiveCode Cross-Platform Development-Joel GerdeenLiveCode Cross-Platform Development-Joel Gerdeen
LiveCode Cross-Platform Development-Joel Gerdeen
Mobile March
 
The Mobile Evolution‚ Systems vs. Apps - Matthew David
The Mobile Evolution‚ Systems vs. Apps - Matthew DavidThe Mobile Evolution‚ Systems vs. Apps - Matthew David
The Mobile Evolution‚ Systems vs. Apps - Matthew David
Mobile March
 
Unity-Beyond Games! - Josh Ruis
Unity-Beyond Games! - Josh RuisUnity-Beyond Games! - Josh Ruis
Unity-Beyond Games! - Josh Ruis
Mobile March
 
IP for Mobile Startups -Ernest Grumbles
IP for Mobile Startups -Ernest GrumblesIP for Mobile Startups -Ernest Grumbles
IP for Mobile Startups -Ernest Grumbles
Mobile March
 
Using Chipmunk Physics to create a iOS Game - Scott Lembcke
Using Chipmunk Physics to create a iOS Game - Scott LembckeUsing Chipmunk Physics to create a iOS Game - Scott Lembcke
Using Chipmunk Physics to create a iOS Game - Scott Lembcke
Mobile March
 
Using Mobile to Achieve Truly Integrated Marketing - Curt Prins
Using Mobile to Achieve Truly Integrated Marketing - Curt PrinsUsing Mobile to Achieve Truly Integrated Marketing - Curt Prins
Using Mobile to Achieve Truly Integrated Marketing - Curt PrinsMobile March
 
Introduction to Core Data - Jason Shapiro
Introduction to Core Data - Jason ShapiroIntroduction to Core Data - Jason Shapiro
Introduction to Core Data - Jason Shapiro
Mobile March
 
Developing Custom iOs Applications for Enterprise
Developing Custom iOs Applications for EnterpriseDeveloping Custom iOs Applications for Enterprise
Developing Custom iOs Applications for Enterprise
Mobile March
 
Product Management for Your App
Product Management for Your AppProduct Management for Your App
Product Management for Your App
Mobile March
 
Dueling Banjos: Inter-app Communication
Dueling Banjos: Inter-app Communication Dueling Banjos: Inter-app Communication
Dueling Banjos: Inter-app Communication Mobile March
 
Guy Thier Keynote Presentation
Guy Thier Keynote PresentationGuy Thier Keynote Presentation
Guy Thier Keynote PresentationMobile March
 
Mobile March Olson presentation 2012
Mobile March Olson presentation 2012Mobile March Olson presentation 2012
Mobile March Olson presentation 2012Mobile March
 
Bannin mobile march_2012_public
Bannin mobile march_2012_publicBannin mobile march_2012_public
Bannin mobile march_2012_public
Mobile March
 
Beginningi os part1-bobmccune
Beginningi os part1-bobmccuneBeginningi os part1-bobmccune
Beginningi os part1-bobmccune
Mobile March
 
Mobile march2012 android101-pt2
Mobile march2012 android101-pt2Mobile march2012 android101-pt2
Mobile march2012 android101-pt2
Mobile March
 
Mobile march2012 android101-pt1
Mobile march2012 android101-pt1Mobile march2012 android101-pt1
Mobile march2012 android101-pt1
Mobile March
 

More from Mobile March (20)

Cross-Platform Mobile Development with PhoneGap-Vince Bullinger
Cross-Platform Mobile Development with PhoneGap-Vince BullingerCross-Platform Mobile Development with PhoneGap-Vince Bullinger
Cross-Platform Mobile Development with PhoneGap-Vince Bullinger
 
You Can’t Ignore the Tablet-Designing & Developing Universal Apps for Phones ...
You Can’t Ignore the Tablet-Designing & Developing Universal Apps for Phones ...You Can’t Ignore the Tablet-Designing & Developing Universal Apps for Phones ...
You Can’t Ignore the Tablet-Designing & Developing Universal Apps for Phones ...
 
Building Wearables-Kristina Durivage
Building Wearables-Kristina DurivageBuilding Wearables-Kristina Durivage
Building Wearables-Kristina Durivage
 
The Blossoming Internet of Things Zach Supalla-Spark
The Blossoming Internet of Things Zach Supalla-SparkThe Blossoming Internet of Things Zach Supalla-Spark
The Blossoming Internet of Things Zach Supalla-Spark
 
LiveCode Cross-Platform Development-Joel Gerdeen
LiveCode Cross-Platform Development-Joel GerdeenLiveCode Cross-Platform Development-Joel Gerdeen
LiveCode Cross-Platform Development-Joel Gerdeen
 
The Mobile Evolution‚ Systems vs. Apps - Matthew David
The Mobile Evolution‚ Systems vs. Apps - Matthew DavidThe Mobile Evolution‚ Systems vs. Apps - Matthew David
The Mobile Evolution‚ Systems vs. Apps - Matthew David
 
Unity-Beyond Games! - Josh Ruis
Unity-Beyond Games! - Josh RuisUnity-Beyond Games! - Josh Ruis
Unity-Beyond Games! - Josh Ruis
 
IP for Mobile Startups -Ernest Grumbles
IP for Mobile Startups -Ernest GrumblesIP for Mobile Startups -Ernest Grumbles
IP for Mobile Startups -Ernest Grumbles
 
Using Chipmunk Physics to create a iOS Game - Scott Lembcke
Using Chipmunk Physics to create a iOS Game - Scott LembckeUsing Chipmunk Physics to create a iOS Game - Scott Lembcke
Using Chipmunk Physics to create a iOS Game - Scott Lembcke
 
Using Mobile to Achieve Truly Integrated Marketing - Curt Prins
Using Mobile to Achieve Truly Integrated Marketing - Curt PrinsUsing Mobile to Achieve Truly Integrated Marketing - Curt Prins
Using Mobile to Achieve Truly Integrated Marketing - Curt Prins
 
Introduction to Core Data - Jason Shapiro
Introduction to Core Data - Jason ShapiroIntroduction to Core Data - Jason Shapiro
Introduction to Core Data - Jason Shapiro
 
Developing Custom iOs Applications for Enterprise
Developing Custom iOs Applications for EnterpriseDeveloping Custom iOs Applications for Enterprise
Developing Custom iOs Applications for Enterprise
 
Product Management for Your App
Product Management for Your AppProduct Management for Your App
Product Management for Your App
 
Dueling Banjos: Inter-app Communication
Dueling Banjos: Inter-app Communication Dueling Banjos: Inter-app Communication
Dueling Banjos: Inter-app Communication
 
Guy Thier Keynote Presentation
Guy Thier Keynote PresentationGuy Thier Keynote Presentation
Guy Thier Keynote Presentation
 
Mobile March Olson presentation 2012
Mobile March Olson presentation 2012Mobile March Olson presentation 2012
Mobile March Olson presentation 2012
 
Bannin mobile march_2012_public
Bannin mobile march_2012_publicBannin mobile march_2012_public
Bannin mobile march_2012_public
 
Beginningi os part1-bobmccune
Beginningi os part1-bobmccuneBeginningi os part1-bobmccune
Beginningi os part1-bobmccune
 
Mobile march2012 android101-pt2
Mobile march2012 android101-pt2Mobile march2012 android101-pt2
Mobile march2012 android101-pt2
 
Mobile march2012 android101-pt1
Mobile march2012 android101-pt1Mobile march2012 android101-pt1
Mobile march2012 android101-pt1
 

Recently uploaded

The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
Globus
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 

Recently uploaded (20)

The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 

Robotium Tutorial

  • 1. Robotium Tutorial Mobile March March 21, 2013 An Intertech Course By Jim White, Intertech, Inc..
  • 2. Course Name Stop by Intertech’s booth for a chance to win FREE Training. Or go to bit.ly.com/intertech-login Slides & demo code available at intertech.com/blog Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 2
  • 3. Course Name Session Agenda • Robotium… • What is it? • Where to get it and how to set it up • “Normal” Android unit testing background • Why Robotium is needed • Using Robotium • Robotium Tips/Tricks/Issues • Complimentary tools • Further Resources • Q&A Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 3
  • 4. Course Name Purpose • The main point/purpose to my talk… • There are wonderful test/QA tools available for Android! • There are no excuses for skipping unit testing in Android! Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 4
  • 5. Course Name Jim White Intro • Intertech Partner, • Dir. of Training, • Instructor, • Consultant • Co-author, J2ME, Java in Small Things (Manning) • Device developer since before phones were “smart” • Java developer when “spring” and “struts” described your stride • Occasional beer drinker Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 5
  • 6. Course Name Robotium – what is it? • An open source test framework • Used to write black or white box tests (emphasis is on black box) • White box testing – testing software that knows and tests the internal structures or workings of an application • Black box testing – testing software functionality without knowledge of an application (perhaps where the source code is not even available) • Tests can be executed on an Android Virtual Device (AVD) or real device • Built on Java (and Android) and JUnit (the Android Test Framework) • In fact, it may be more appropriate to call Robotium an extension to the Android test framework Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 6
  • 7. Course Name Robotium Project Setup • Prerequisites • Install and setup JDK • Install and setup Eclipse (optional) • Install and setup Android Standard Development Kit (SDK) • Supports Android 1.6 (API level 4) and above • Install and setup Android Development Tools (ADT) for Eclipse (optional) • Create Android AVD or attach device by USB • Create an Android Test Project • Download Robotium JAR and add to project classpath • robotium-solo-X.X.jar (version 3.6 the latest as of this writing) • From code.google.com/p/robotium/downloads/list Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 7
  • 8. Course Name Background - Android JUnit Testing • Android testing is based on JUnit • You create test suites, classes (test cases), methods • Organize tests into a Android Test project • Android API supports JUnit 3 code style – not JUnit 4! • No annotations • Old JUnit naming conventions • Test case classes can extend good-old-fashion JUnit3 TestCase • To call Android APIs, base class must extend AndroidTestCase • Use JUnit Assert class to check/display test results • Execute tests using an SDK provided InstrumentationTestRunner • android.test.InstrumentationTestRunner • Usually handled automatically via IDE Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 8
  • 9. Course Name Android Test Architecture • Architecturally, the unit testing project and app project run on the same JVM (i.e. DVM). Test case classes, instrumentation, JUnit, mock objects, etc. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 9
  • 10. Course Name Robotium Project Setup • Add Robotium JAR to the Java • Put Robotium in the build path Build Path order. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 10
  • 11. Course Name Android JUnit Project Setup Demo Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 11
  • 12. Course Name The “App” Used To Demo Today • Want to make sure data is entered. • Want to make sure data is valid. • Age is less than 122 • Zip has 5 characters • Make sure a role is clicked. • Make sure clear does clear the fields. • Etc. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 12
  • 13. Course Name Example JUnit Test (Continued) public class TestDataCollection extends ActivityInstrumentationTestCase2<DataCollectionActivity> { DataCollectionActivity activity; public TestDataCollection() { Extends AndroidTestCase – super(DataCollectionActivity.class); provides functionality for testing a single Activity. Need to associate it } to an Activity type (like DataCollectionActivity) @Override public void setUp() throws Exception { super.setUp(); Test case initialization method (just activity = getActivity(); like JUnit 3). } @Override protected void tearDown() throws Exception { activity.finish(); Test case tear down method (just super.tearDown(); like JUnit 3). Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 13 }
  • 14. Course Name Example JUnit Test (Continued) Test methods must begin with “test”. public void testCheckNameClear() { final EditText name = (EditText) activity.findViewById(R.id.nameEdit); activity.runOnUiThread(new Runnable() { Grab widgets by public void run() { their Android ID. name.requestFocus(); UI adjustments/ work must } be done on UI thread }); sendKeys("J I M"); TestCase, TouchUtils Button button = (Button) activity.findViewById(R.id.clearButton); provide limited UI TouchUtils.clickView(this, button); maneuvering, but assertTrue("First name field is not empty.", name.getText().toString().equals("")); again requires } deep knowledge } of the UI details Normal assert methods to check results. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 14
  • 15. Course Name Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 15
  • 16. Course Name Why Android JUnit Isn’t Enough • Requires deep knowledge of widgets • Widget IDs • Widget Properties • What has focus • Order of widgets • Etc. • Often requires deep knowledge of Android internals • Especially around menus, dialogs, etc. • Makes for brittle unit tests • As the UI changes, the test often must change dramatically. • Poor instrumentation • Instrumentation is a feature in which specific monitoring of the interactions between an application and the system are made possible. • Use of runOnUIThread to execute UI work that isn’t covered by TouchUtils or TestCase class. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 16
  • 17. Course Name Example Robotium • Use Robotium tests in JUnit test class • Same code as in TestDataCollectionActivity above… • With a few additions/changes. private Solo solo; @Override Add a Solo member public void setUp() throws Exception { variable and initialize it super.setUp(); during setUp( ). activity = getActivity(); solo= new Solo(getInstrumentation(), getActivity()); } Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 17
  • 18. Course Name Example Robotium (Continued) • The new test method – greatly simplified via Robotium! public void testCheckNameClear() { solo.enterText(0, "Jim"); // 0 is the index of the EditText field solo.clickOnButton("Clear"); assertTrue("First name field is not empty.",solo.getEditText(0). getText().toString().equals("")); } Solo methods allow widgets to be selected and interacted with. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 18
  • 19. Course Name Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 19
  • 20. Course Name Robotium Solo API • Robotium is all baked into one class - Solo – with many methods: • clickX methods: clickOnButton, clickOnImage, clickOnText,… • clickLongX methods: clickLongInList, clickLongOnScreen, clickLongOnText,… • enterText • drag • getX methods: getButton, getCurrentActivity, getImage, getEditText, … • goBack • isX methods: isCheckBoxChecked, isRadioButtonChecked, isSpinnerTextSelected, isTextChecked,… • pressX methods: pressMenuItem, pressMenuItem, pressSpinnerItem, … • scrollX methods: scrollToTop, scrollToBottom, … • searchX methods: searchButton, searchEditText, searchText, … • waitForX methods: waitForActivity, waitForText, … Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 20
  • 21. Course Name Android Robotium Demo Demo Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 21
  • 22. Course Name Tips & Tricks • Robotium (and all JUnit tests) operate in the same process (DVM) as the original app • Robotium only works with the activities and views within the defined app • For example: Can’t use intent to launch another app and test activity work from that app • The popup keyboard is accomplished with a bitmap in Android • Robotium (or any unit test software) doesn’t see the “keys” as buttons or anything. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 22
  • 23. Course Name Tips & Tricks (Continued) • Use waitFor methods liberally. • Especially if new screen opens or changes to what is displayed are occurring. • The waitFor methods tell Robotium to wait for a condition to happen before the execution continues. public void testGoodLogin() { solo.enterText(0, “username"); solo.enterText(1, “password"); String label = res.getString(R.string.login_button_label); solo.clickOnButton(label); String title = res.getString(R.string.title_activity_systemv); solo.waitForText(title); solo.assertCurrentActivity("systemv", SystemVActivity.class); solo.getCurrentActivity().finish(); } Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 23
  • 24. Course Name Tips & Tricks (Continued) • RadioButtons are Buttons, EditText are Text, etc… • Getting the proper widget by index can be more difficult • Use of index also makes the test case more brittle due to potential layout changes • Consider clickOnButton(“Clear”) vs. clickOnButton(6) Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 24
  • 25. Course Name Tips & Tricks (Continued) • Resources in Android are at a premium (especially when test cases and App code are running in same DVM). • Use solo.finishOpenedActivities() in your tearDown method. • It closes all the opened activities. • Frees resources for the next tests • Robotium has some difficulty with animations • Robotium doesn’t work with status bar notifications Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 25
  • 26. Course Name Tips & Tricks – Black Box Testing • Black Box Testing (when all you have is the APK file) is a little more tricky. • Recall in the demo, the test application wants the main activity name? public TestDataCollectionActivity() { super(DataCollectionActivity.class); } • You may not know this for a 3rd party/black box app. • You can get the activity name by loading the APK to an AVD or device, running it, and watching the logcat. • The APK file has to have the same certificate signature as the test project. • Probably have to delete the signature and then resign the APK with the Android debug key signature. • It’s easier than it sounds. See referenced document for help. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 26
  • 27. Course Name Android Robotium Black Box Demo Black Box Demo Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 27
  • 28. Course Name Robotium Additional Features • Robotium can automatically take screenshots • solo.takeScreenshot( ) • Robotium can be run from the command line (using adb shell) • adb shell am instrument -w com.android.foo/android.test.InstrumentationTestRunner • Robotium can test with localized strings • solo.getString(localized_resource_string_id) • Code coverage is a bit lackluster at this time • Can be done with special ant task and command line tools • Robotium does not work on Flash or Web apps. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 28
  • 29. Course Name Complimentary Tools • Robotium Testroid Recorder • Record actions to generate Android JUnit/Robotium test cases • Run tests on 180 devices “in the cloud” • Testdroid.com • Commercial product (50 runs free, $99/month or ¢99/run) • Robotium Remote Control • Allows Robotium test cases to be executed from the JVM (on a PC) • This allows Robotium to work with JUnit 4. • code.google.com/p/robotium/wiki/RemoteControl Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 29
  • 30. Course Name Resources • These slides and demo code: intertech.com/blog • Google Robotium site • code.google.com/p/robotium • code.google.com/p/robotium/wiki/RobotiumTutorials • Tutorial Articles/Blog Posts • devblog.xing.com/qa/robotium-atxing/ • www.netmagazine.com/tutorials/automate-your-android-app-testing • robotiumsolo.blogspot.com/2012/12/what-is-robotium.html • www.vogella.com/articles/AndroidTesting/article.html • robotium.googlecode.com/files/RobotiumForBeginners.pdf • excellent article for black box testing when all you have is the APK • Fundamentals of Android Unit Testing • developer.android.com/tools/testing/testing_android.html Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 30
  • 31. Course Name Q&A • Questions – you got’em, I want’em Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 31
  • 32. Course Name Award-Winning Training and Consulting. Visit www.Intertech.com for complete details. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 32
  • 33. Course Name Intertech offers Mobile Training On: • Android • HTML5 • iOS • Java ME • jQuery • Windows Phone Visit ww.Intertech.com for complete course schedule. Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 33
  • 34. Course Name Stop by Intertech’s booth for a chance to win FREE Training. Or go to bit.ly.com/intertech-login Copyright © Intertech, Inc. • www.Intertech.com • 800-866-9884 Slide 34