Automated UI Testing for Web and Native Apps on iOS and Android

Operation Mobile
Operation MobileHire us for your mobile mission
Automated UI Testing for
Web and Native Apps on
iOS and Android




                    Operation Mobile
What I’ll be covering

     What are automated UI tests and why should you
     care?

     How to test mobile web apps

     How to test native Android apps

     Common automation test pitfalls

     How to pick a test framework

     The future and how to test native iOS apps


                                        Operation Mobile
The difference between unit and automation
tests

Performing actions on a user
interface (UI)



Automated UI tests are done at
a higher level than unit tests




                                  Operation Mobile
All that matters is the total is what we expect




                                      Operation Mobile
We will be automating UI tests for a calculator


              1.   Can add two numbers together

                   Given the user enters 1 and 2
                   When the user touches calculate
                   Then the total should be 3


              2.   Can clear the screen

                   Given the user enters 1 and 2
                   When the user touches clear
                   Then the first number should be blank
                   And the second number should be blank
                   And the total should be 0




                                               Operation Mobile
Why do automated UI testing for mobile apps?




Design and marketing will get you users
But if an app doesn’t function properly
Users might give one star ratings and won’t
recommend it


                                          Operation Mobile
Each new function = something else to test




iCalc v1    iCalc v2       iCalc v3       iCalc v4
 Add        Add           Add           Add
   Clear      Clear         Clear         Clear
               Subtract      Subtract      Subtract
                              Multiply      Multiply
                                             Divide



                                          Operation Mobile
Each new view = somewhere else to test




                                  Operation Mobile
Will you really remember to test everything?

        Because you decide to go on holiday for a
        while... around the world



        You developed another app




        You’re human




                                       Operation MOBILE
But I never changed that bit...

        Forgot that something else also used that
        code

        Made an accidental typo because you’re
        human




                                       Operation Mobile
What about if you work in a team?

        Do you know how to test what each other
        have done?




                                      Operation Mobile
Automated UI tests can run on multiple devices

        Run the same tests for tablet and phone
        using simulator saving you time

        Run different tests for tablet and phone
        using simulator saving you time and
        remembering what to test on what device




                                       Operation Mobile
Automated UI tests can target SDKs

        Run tests for older version for backwards
        compatibility saving you time


        Run tests on newer versions to give you a
        heads up




                                       Operation Mobile
Automated UI tests vs. QA

        Never be as good as having a (good) QA




        But will be cheaper



        And faster




                                      Operation Mobile
On the subject of cost automated UI testing is...

        Every framework I’ll be showing you is open
        source




                                       Operation Mobile
Automating UI tests for Web Apps




          Selenium - http://seleniumhq.org/




                                      Operation Mobile
How Selenium works


         Install and run iWebDriver application
         onto the device. This runs a webserver
         which listens for commands...



         which you send from your computer.
         Similar to using a remote control.




                                      Operation Mobile
Automated UI tests for web apps using Selenium




  Watch this video on YouTube - http://youtu.be/51E3FWMKkig




                                                Operation Mobile
Same for Android

   Follow the instructions here:
    http://code.google.com/p/selenium/wiki/AndroidDriver


   Install an APK instead of an APP

   Set up port forwarding




                                                    Operation Mobile
Automated UI tests for native Android apps

The good news is...


              A UI Automation test framework already
              comes with the Android SDK

              But we are not going to use it (directly
              anyway) because...




                                           Operation Mobile
Robotium is the best way to test Android Apps

        Robotium   http://code.google.com/p/robotium/



        Uses the Android test framework and solves
        a very important issue...




                                              Operation Mobile
Can deal with tests running faster than UI threads

        Your UI test can perform actions faster than
        you can but...



        that means it will expect something to
        happen faster the UI finishes its task


        Robotium is clever enough to wait for things
        to happen – no sleeps required!



                                        Operation Mobile
Why use Robotium instead of standard SDK

       Robotium uses Solo, which allows to
       simulate gestures



       Active community to help if you get stuck




       Gets updated more often than Android SDK



                                      Operation Mobile
Automating Android native apps using Robotium




  Watch this video on YouTube - http://youtu.be/XsNxZn7f7Xc




                                                 Operation Mobile
Common pitfalls of automated UI testing

      Too many unnecessary tests that don’t
      add value e.g. testing the SDK

      Fragile tests use position
      index, hierarchy in layout etc.


      Too many changes in one go


      Over reliance on one person – he’s the
      <insert role> guy


                                        Operation Mobile
How to pick the right framework


       Get your hands dirty and try it out


       Good learning resources


       Good community support


       Does it have ‘most’ of the functionality
       you require?


                                          Operation Mobile
The future...

          So far all tests you’ve seen look like
          they’ve been written by developers...


          but we’re testing at a higher level than
          unit tests...


          because we’re testing behaviour (BDD)


            So why can’t our tests be written in
            English?

                                          Operation Mobile
Calculator tests in English

Scenario: Can add two numbers together
When I type "1" into "firstNumber“
And I type "2" into "secondNumber"
And I touch the "Calculate" button
Then the total should be 3

Scenario: Can clear all fields
When I type "1" into "firstNumber"
And I type "2" into "secondNumber"
And I touch the "Clear" button
Then the total should be 0
And the "firstNumber" should be empty
And the "secondNumber" should be empty



                                         Operation Mobile
Frank + Cucumber + UISpec makes this possible

      Frank - https://github.com/moredip/Frank
      (By Universal Studios (Frankenstein promotional photo) [Public domain], via Wikimedia Commons)




      Uses Cucumber and UISpec to run
      scenarios as automated UI tests


      Cucumber uses Ruby to convert text into code

      But lots of built in steps for you to use
      e.g. When I touch <UI Element>


                                                                                           Operation Mobile
Automated UI tests for iOS native apps with Frank




  Watch this video on YouTube - http://youtu.be/tvv7kbvNb-8




                                                  Operation Mobile
Why automate UI tests using scenarios?


        Perfect match for storyboards (new in
        iOS 5)


        And because they can be converted in
        into Objective C, Java etc...


        The same scenario could be used test
        the same app on iOS, Android, Windows,
        Balckberry etc.


                                      Operation Mobile
To conclude…


      Get your hands dirty and try it out




                                        Operation Mobile
1 of 32

Recommended

Introduction to Mobile-UI Automated Testing Tools by
Introduction to Mobile-UI Automated Testing ToolsIntroduction to Mobile-UI Automated Testing Tools
Introduction to Mobile-UI Automated Testing Toolsi_am_craig
1.5K views14 slides
Mobility testing by
Mobility testingMobility testing
Mobility testingPrecise Testing Solution
375 views9 slides
Automated UI Testing Frameworks by
Automated UI Testing FrameworksAutomated UI Testing Frameworks
Automated UI Testing FrameworksTestObject - Mobile Testing
32.2K views23 slides
Mobile automation – should I use robotium or calabash or appium? by
Mobile automation – should I use robotium or calabash or appium?Mobile automation – should I use robotium or calabash or appium?
Mobile automation – should I use robotium or calabash or appium?Zado Technologies
6.3K views2 slides
Using Selenium to Test Native Apps (Wait, you can do that?) by
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
13.6K views65 slides
Appium: Automation for Mobile Apps by
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile AppsSauce Labs
27.8K views39 slides

More Related Content

What's hot

Mobile automation testing with selenium and appium by
Mobile automation testing with selenium and appiumMobile automation testing with selenium and appium
Mobile automation testing with selenium and appiumBugRaptors
264 views9 slides
Getting started with appium by
Getting started with appiumGetting started with appium
Getting started with appiumPratik Patel
618 views41 slides
Appium by
AppiumAppium
AppiumSveta Fedik
1K views6 slides
Appium ppt by
Appium pptAppium ppt
Appium pptnatashasweety7
1.8K views11 slides
Different Android Test Automation Frameworks - What Works You the Best? by
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
34K views45 slides
Appium Interview Questions and Answers | Edureka by
Appium Interview Questions and Answers | EdurekaAppium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaEdureka!
575 views115 slides

What's hot(20)

Mobile automation testing with selenium and appium by BugRaptors
Mobile automation testing with selenium and appiumMobile automation testing with selenium and appium
Mobile automation testing with selenium and appium
BugRaptors264 views
Getting started with appium by Pratik Patel
Getting started with appiumGetting started with appium
Getting started with appium
Pratik Patel618 views
Different Android Test Automation Frameworks - What Works You the Best? by Bitbar
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?
Bitbar34K views
Appium Interview Questions and Answers | Edureka by Edureka!
Appium Interview Questions and Answers | EdurekaAppium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | Edureka
Edureka!575 views
MonkeyTalk Automation Testing For Android Application by ContusQA
MonkeyTalk Automation Testing For Android ApplicationMonkeyTalk Automation Testing For Android Application
MonkeyTalk Automation Testing For Android Application
ContusQA30.8K views
Appium Mobile Test Automation like WebDriver by Andrii Dzynia
Appium Mobile Test Automation like WebDriverAppium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriver
Andrii Dzynia23.6K views
Appium overview (Selenium Israel #2, Feb. 2014) by danielputerman
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
danielputerman4.4K views
Appium basics by Syam Sasi
Appium basicsAppium basics
Appium basics
Syam Sasi669 views
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium by Srijan Technologies
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
Android UI Testing with Appium by Luke Maung
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
Luke Maung10.9K views
Appium meet up noida by Amit Rawat
Appium meet up noidaAppium meet up noida
Appium meet up noida
Amit Rawat1.4K views
Appium workship, Mobile Web+Dev Conference by Isaac Murchie
Appium workship,  Mobile Web+Dev ConferenceAppium workship,  Mobile Web+Dev Conference
Appium workship, Mobile Web+Dev Conference
Isaac Murchie807 views

Viewers also liked

QA on a Large-Scale Medical Project. Automation as a Necessity by
QA on a Large-Scale Medical Project. Automation as a NecessityQA on a Large-Scale Medical Project. Automation as a Necessity
QA on a Large-Scale Medical Project. Automation as a NecessityGlobalLogic Ukraine
1.3K views15 slides
Advanced Coded UI Testing by
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI TestingShai Raiten
88.1K views62 slides
10 Benefits of Automated Testing by
10 Benefits of Automated Testing10 Benefits of Automated Testing
10 Benefits of Automated TestingTestObject - Mobile Testing
89.7K views26 slides
Boston meetup blaze_meter_feb2017 by
Boston meetup blaze_meter_feb2017Boston meetup blaze_meter_feb2017
Boston meetup blaze_meter_feb2017Perfecto Mobile
10.1K views21 slides
Mobile Application Testing by
Mobile Application TestingMobile Application Testing
Mobile Application TestingSWAAM Tech
24.5K views42 slides
Mobile App Testing Checklist by
Mobile App Testing ChecklistMobile App Testing Checklist
Mobile App Testing ChecklistManoj Lonar
34K views15 slides

Viewers also liked(10)

QA on a Large-Scale Medical Project. Automation as a Necessity by GlobalLogic Ukraine
QA on a Large-Scale Medical Project. Automation as a NecessityQA on a Large-Scale Medical Project. Automation as a Necessity
QA on a Large-Scale Medical Project. Automation as a Necessity
GlobalLogic Ukraine1.3K views
Advanced Coded UI Testing by Shai Raiten
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI Testing
Shai Raiten88.1K views
Boston meetup blaze_meter_feb2017 by Perfecto Mobile
Boston meetup blaze_meter_feb2017Boston meetup blaze_meter_feb2017
Boston meetup blaze_meter_feb2017
Perfecto Mobile10.1K views
Mobile Application Testing by SWAAM Tech
Mobile Application TestingMobile Application Testing
Mobile Application Testing
SWAAM Tech24.5K views
Mobile App Testing Checklist by Manoj Lonar
Mobile App Testing ChecklistMobile App Testing Checklist
Mobile App Testing Checklist
Manoj Lonar34K views
The Future of UI - How Mobile Design is Shaping The Web 2 by Sara Cannon
The Future of UI - How Mobile Design is Shaping The Web 2The Future of UI - How Mobile Design is Shaping The Web 2
The Future of UI - How Mobile Design is Shaping The Web 2
Sara Cannon36.5K views
Cloud based Testing Mobile Apps by IndicThreads
Cloud based Testing Mobile AppsCloud based Testing Mobile Apps
Cloud based Testing Mobile Apps
IndicThreads5.8K views
Simple Steps to UX/UI Web Design by Koombea
Simple Steps to UX/UI Web DesignSimple Steps to UX/UI Web Design
Simple Steps to UX/UI Web Design
Koombea441.3K views
The Future Of Work & The Work Of The Future by Arturo Pelayo
The Future Of Work & The Work Of The FutureThe Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The Future
Arturo Pelayo447.4K views

Similar to Automated UI Testing for Web and Native Apps on iOS and Android

How to Master Mobile Automation in QA by
How to Master Mobile Automation in QAHow to Master Mobile Automation in QA
How to Master Mobile Automation in QAOxagile
1.3K views16 slides
Cucumber meets iPhone by
Cucumber meets iPhoneCucumber meets iPhone
Cucumber meets iPhoneErin Dees
19.9K views62 slides
Mobile UI Testing using Appium and Docker by
Mobile UI Testing using Appium and DockerMobile UI Testing using Appium and Docker
Mobile UI Testing using Appium and DockerMoataz Nabil
5.7K views39 slides
Velocity Conference: Increasing Speed To Market In Mobile Development Through... by
Velocity Conference: Increasing Speed To Market In Mobile Development Through...Velocity Conference: Increasing Speed To Market In Mobile Development Through...
Velocity Conference: Increasing Speed To Market In Mobile Development Through...Intuit Inc.
2.4K views32 slides
The Future of Selenium Testing for Mobile Web and Native Apps by
The Future of Selenium Testing for Mobile Web and Native AppsThe Future of Selenium Testing for Mobile Web and Native Apps
The Future of Selenium Testing for Mobile Web and Native AppsSauce Labs
4.8K views75 slides
Automated Application Testing by
Automated Application TestingAutomated Application Testing
Automated Application TestingCodal
69 views8 slides

Similar to Automated UI Testing for Web and Native Apps on iOS and Android(20)

How to Master Mobile Automation in QA by Oxagile
How to Master Mobile Automation in QAHow to Master Mobile Automation in QA
How to Master Mobile Automation in QA
Oxagile1.3K views
Cucumber meets iPhone by Erin Dees
Cucumber meets iPhoneCucumber meets iPhone
Cucumber meets iPhone
Erin Dees19.9K views
Mobile UI Testing using Appium and Docker by Moataz Nabil
Mobile UI Testing using Appium and DockerMobile UI Testing using Appium and Docker
Mobile UI Testing using Appium and Docker
Moataz Nabil5.7K views
Velocity Conference: Increasing Speed To Market In Mobile Development Through... by Intuit Inc.
Velocity Conference: Increasing Speed To Market In Mobile Development Through...Velocity Conference: Increasing Speed To Market In Mobile Development Through...
Velocity Conference: Increasing Speed To Market In Mobile Development Through...
Intuit Inc.2.4K views
The Future of Selenium Testing for Mobile Web and Native Apps by Sauce Labs
The Future of Selenium Testing for Mobile Web and Native AppsThe Future of Selenium Testing for Mobile Web and Native Apps
The Future of Selenium Testing for Mobile Web and Native Apps
Sauce Labs4.8K views
Automated Application Testing by Codal
Automated Application TestingAutomated Application Testing
Automated Application Testing
Codal69 views
2012 mobile testingsummit-moet by Eing Ong
2012 mobile testingsummit-moet2012 mobile testingsummit-moet
2012 mobile testingsummit-moet
Eing Ong493 views
Velocity2013 mobile ci_intuit by Tina Su
Velocity2013 mobile ci_intuitVelocity2013 mobile ci_intuit
Velocity2013 mobile ci_intuit
Tina Su262 views
Speed to Market in Mobile Development by Tina Su
Speed to Market in Mobile DevelopmentSpeed to Market in Mobile Development
Speed to Market in Mobile Development
Tina Su442 views
Velocity2013 mobile ci_intuit by Tina Su
Velocity2013 mobile ci_intuitVelocity2013 mobile ci_intuit
Velocity2013 mobile ci_intuit
Tina Su258 views
Android testing by Bitbar
Android testingAndroid testing
Android testing
Bitbar7.4K views
Mobile applications and automation testing by Dipesh Bhatewara
Mobile applications and automation testingMobile applications and automation testing
Mobile applications and automation testing
Dipesh Bhatewara535 views
Android testing by JinaTm
Android testingAndroid testing
Android testing
JinaTm3.6K views
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap... by İbrahim KIVANÇ
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
İbrahim KIVANÇ584 views
Benefits of using native automation tooling for mobile application testing.pptx by Mesut Günes
Benefits of using native automation tooling for mobile application testing.pptxBenefits of using native automation tooling for mobile application testing.pptx
Benefits of using native automation tooling for mobile application testing.pptx
Mesut Günes25 views
Justin Ison by CodeFest
Justin IsonJustin Ison
Justin Ison
CodeFest198 views
2012 java one-con3648 by Eing Ong
2012 java one-con36482012 java one-con3648
2012 java one-con3648
Eing Ong787 views

Recently uploaded

Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPoolShapeBlue
123 views10 slides
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlueShapeBlue
147 views23 slides
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...ShapeBlue
180 views18 slides
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITShapeBlue
206 views8 slides
Business Analyst Series 2023 - Week 4 Session 8 by
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8DianaGray10
123 views13 slides
NTGapps NTG LowCode Platform by
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform Mustafa Kuğu
423 views30 slides

Recently uploaded(20)

Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by ShapeBlue
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool
ShapeBlue123 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue147 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue180 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue206 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10123 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu423 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE79 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue198 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue166 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue161 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10139 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue221 views
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue186 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue138 views
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue145 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue238 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue135 views

Automated UI Testing for Web and Native Apps on iOS and Android

  • 1. Automated UI Testing for Web and Native Apps on iOS and Android Operation Mobile
  • 2. What I’ll be covering What are automated UI tests and why should you care? How to test mobile web apps How to test native Android apps Common automation test pitfalls How to pick a test framework The future and how to test native iOS apps Operation Mobile
  • 3. The difference between unit and automation tests Performing actions on a user interface (UI) Automated UI tests are done at a higher level than unit tests Operation Mobile
  • 4. All that matters is the total is what we expect Operation Mobile
  • 5. We will be automating UI tests for a calculator 1. Can add two numbers together Given the user enters 1 and 2 When the user touches calculate Then the total should be 3 2. Can clear the screen Given the user enters 1 and 2 When the user touches clear Then the first number should be blank And the second number should be blank And the total should be 0 Operation Mobile
  • 6. Why do automated UI testing for mobile apps? Design and marketing will get you users But if an app doesn’t function properly Users might give one star ratings and won’t recommend it Operation Mobile
  • 7. Each new function = something else to test iCalc v1 iCalc v2 iCalc v3 iCalc v4  Add  Add  Add  Add  Clear  Clear  Clear  Clear  Subtract  Subtract  Subtract  Multiply  Multiply  Divide Operation Mobile
  • 8. Each new view = somewhere else to test Operation Mobile
  • 9. Will you really remember to test everything? Because you decide to go on holiday for a while... around the world You developed another app You’re human Operation MOBILE
  • 10. But I never changed that bit... Forgot that something else also used that code Made an accidental typo because you’re human Operation Mobile
  • 11. What about if you work in a team? Do you know how to test what each other have done? Operation Mobile
  • 12. Automated UI tests can run on multiple devices Run the same tests for tablet and phone using simulator saving you time Run different tests for tablet and phone using simulator saving you time and remembering what to test on what device Operation Mobile
  • 13. Automated UI tests can target SDKs Run tests for older version for backwards compatibility saving you time Run tests on newer versions to give you a heads up Operation Mobile
  • 14. Automated UI tests vs. QA Never be as good as having a (good) QA But will be cheaper And faster Operation Mobile
  • 15. On the subject of cost automated UI testing is... Every framework I’ll be showing you is open source Operation Mobile
  • 16. Automating UI tests for Web Apps Selenium - http://seleniumhq.org/ Operation Mobile
  • 17. How Selenium works Install and run iWebDriver application onto the device. This runs a webserver which listens for commands... which you send from your computer. Similar to using a remote control. Operation Mobile
  • 18. Automated UI tests for web apps using Selenium Watch this video on YouTube - http://youtu.be/51E3FWMKkig Operation Mobile
  • 19. Same for Android  Follow the instructions here: http://code.google.com/p/selenium/wiki/AndroidDriver  Install an APK instead of an APP  Set up port forwarding Operation Mobile
  • 20. Automated UI tests for native Android apps The good news is... A UI Automation test framework already comes with the Android SDK But we are not going to use it (directly anyway) because... Operation Mobile
  • 21. Robotium is the best way to test Android Apps Robotium http://code.google.com/p/robotium/ Uses the Android test framework and solves a very important issue... Operation Mobile
  • 22. Can deal with tests running faster than UI threads Your UI test can perform actions faster than you can but... that means it will expect something to happen faster the UI finishes its task Robotium is clever enough to wait for things to happen – no sleeps required! Operation Mobile
  • 23. Why use Robotium instead of standard SDK Robotium uses Solo, which allows to simulate gestures Active community to help if you get stuck Gets updated more often than Android SDK Operation Mobile
  • 24. Automating Android native apps using Robotium Watch this video on YouTube - http://youtu.be/XsNxZn7f7Xc Operation Mobile
  • 25. Common pitfalls of automated UI testing Too many unnecessary tests that don’t add value e.g. testing the SDK Fragile tests use position index, hierarchy in layout etc. Too many changes in one go Over reliance on one person – he’s the <insert role> guy Operation Mobile
  • 26. How to pick the right framework Get your hands dirty and try it out Good learning resources Good community support Does it have ‘most’ of the functionality you require? Operation Mobile
  • 27. The future... So far all tests you’ve seen look like they’ve been written by developers... but we’re testing at a higher level than unit tests... because we’re testing behaviour (BDD) So why can’t our tests be written in English? Operation Mobile
  • 28. Calculator tests in English Scenario: Can add two numbers together When I type "1" into "firstNumber“ And I type "2" into "secondNumber" And I touch the "Calculate" button Then the total should be 3 Scenario: Can clear all fields When I type "1" into "firstNumber" And I type "2" into "secondNumber" And I touch the "Clear" button Then the total should be 0 And the "firstNumber" should be empty And the "secondNumber" should be empty Operation Mobile
  • 29. Frank + Cucumber + UISpec makes this possible Frank - https://github.com/moredip/Frank (By Universal Studios (Frankenstein promotional photo) [Public domain], via Wikimedia Commons) Uses Cucumber and UISpec to run scenarios as automated UI tests Cucumber uses Ruby to convert text into code But lots of built in steps for you to use e.g. When I touch <UI Element> Operation Mobile
  • 30. Automated UI tests for iOS native apps with Frank Watch this video on YouTube - http://youtu.be/tvv7kbvNb-8 Operation Mobile
  • 31. Why automate UI tests using scenarios? Perfect match for storyboards (new in iOS 5) And because they can be converted in into Objective C, Java etc... The same scenario could be used test the same app on iOS, Android, Windows, Balckberry etc. Operation Mobile
  • 32. To conclude… Get your hands dirty and try it out Operation Mobile