Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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

 ...
The difference between unit and automation
tests

Performing actions on a user
interface (UI)



Automated UI tests are do...
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

                   Give...
Why do automated UI testing for mobile apps?




Design and marketing will get you users
But if an app doesn’t function pr...
Each new function = something else to test




iCalc v1    iCalc v2       iCalc v3       iCalc v4
 Add        Add       ...
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 th...
But I never changed that bit...

        Forgot that something else also used that
        code

        Made an accidenta...
What about if you work in a team?

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




                ...
Automated UI tests can run on multiple devices

        Run the same tests for tablet and phone
        using simulator sa...
Automated UI tests can target SDKs

        Run tests for older version for backwards
        compatibility saving you tim...
Automated UI tests vs. QA

        Never be as good as having a (good) QA




        But will be cheaper



        And f...
On the subject of cost automated UI testing is...

        Every framework I’ll be showing you is open
        source




...
Automating UI tests for Web Apps




          Selenium - http://seleniumhq.org/




                                     ...
How Selenium works


         Install and run iWebDriver application
         onto the device. This runs a webserver
     ...
Automated UI tests for web apps using Selenium




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




       ...
Same for Android

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


   Install...
Automated UI tests for native Android apps

The good news is...


              A UI Automation test framework already
   ...
Robotium is the best way to test Android Apps

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



        Uses the A...
Can deal with tests running faster than UI threads

        Your UI test can perform actions faster than
        you can b...
Why use Robotium instead of standard SDK

       Robotium uses Solo, which allows to
       simulate gestures



       Ac...
Automating Android native apps using Robotium




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




        ...
Common pitfalls of automated UI testing

      Too many unnecessary tests that don’t
      add value e.g. testing the SDK
...
How to pick the right framework


       Get your hands dirty and try it out


       Good learning resources


       Goo...
The future...

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


        ...
Calculator tests in English

Scenario: Can add two numbers together
When I type "1" into "firstNumber“
And I type "2" into...
Frank + Cucumber + UISpec makes this possible

      Frank - https://github.com/moredip/Frank
      (By Universal Studios ...
Automated UI tests for iOS native apps with Frank




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




    ...
Why automate UI tests using scenarios?


        Perfect match for storyboards (new in
        iOS 5)


        And becaus...
To conclude…


      Get your hands dirty and try it out




                                        Operation Mobile
Upcoming SlideShare
Loading in …5
×

of

Automated UI Testing for  Web and Native Apps on iOS and Android Slide 1 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 2 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 3 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 4 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 5 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 6 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 7 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 8 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 9 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 10 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 11 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 12 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 13 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 14 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 15 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 16 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 17 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 18

YouTube videos are no longer supported on SlideShare

View original on YouTube

Automated UI Testing for  Web and Native Apps on iOS and Android Slide 20 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 21 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 22 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 23 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 24

YouTube videos are no longer supported on SlideShare

View original on YouTube

Automated UI Testing for  Web and Native Apps on iOS and Android Slide 26 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 27 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 28 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 29 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 30

YouTube videos are no longer supported on SlideShare

View original on YouTube

Automated UI Testing for  Web and Native Apps on iOS and Android Slide 32 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 33 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 34 Automated UI Testing for  Web and Native Apps on iOS and Android Slide 35
Upcoming SlideShare
QA on a Large-Scale Medical Project. Automation as a Necessity
Next

66 Likes

Share

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

How to automate UI tests for Web and Native Apps on iOS and Android

Related Books

Free with a 30 day trial from Scribd

See all

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

  1. 1. Automated UI Testing for Web and Native Apps on iOS and Android Operation Mobile
  2. 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. 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. 4. All that matters is the total is what we expect Operation Mobile
  5. 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. 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. 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. 8. Each new view = somewhere else to test Operation Mobile
  9. 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. 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. 11. What about if you work in a team? Do you know how to test what each other have done? Operation Mobile
  12. 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. 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. 14. Automated UI tests vs. QA Never be as good as having a (good) QA But will be cheaper And faster Operation Mobile
  15. 15. On the subject of cost automated UI testing is... Every framework I’ll be showing you is open source Operation Mobile
  16. 16. Automating UI tests for Web Apps Selenium - http://seleniumhq.org/ Operation Mobile
  17. 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. 18. Automated UI tests for web apps using Selenium Watch this video on YouTube - http://youtu.be/51E3FWMKkig Operation Mobile
  19. 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. 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. 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. 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. 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. 24. Automating Android native apps using Robotium Watch this video on YouTube - http://youtu.be/XsNxZn7f7Xc Operation Mobile
  25. 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. 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. 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. 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. 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. 30. Automated UI tests for iOS native apps with Frank Watch this video on YouTube - http://youtu.be/tvv7kbvNb-8 Operation Mobile
  31. 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. 32. To conclude… Get your hands dirty and try it out Operation Mobile
  • jeffreywang3139

    Feb. 6, 2016
  • stephaniefriasz

    Oct. 19, 2015
  • zling2001

    Jul. 23, 2015
  • AnilkumarDhulappanavar

    Jul. 19, 2015
  • fphilip

    Mar. 17, 2015
  • rueywu

    Nov. 18, 2013
  • daotrongthanh

    Aug. 9, 2013
  • shyambuddi

    Jul. 9, 2013
  • bavhel

    Jun. 20, 2013
  • lucker6666

    Jun. 2, 2013
  • TudorJuravlea

    May. 16, 2013
  • BliaSxion

    Apr. 22, 2013
  • lukianovsky

    Apr. 7, 2013
  • dimar

    Mar. 18, 2013
  • yankchina

    Mar. 9, 2013
  • AlanTo1

    Feb. 19, 2013
  • tzhang

    Feb. 19, 2013
  • bbannan

    Feb. 13, 2013
  • xialingxue1

    Jan. 23, 2013
  • akirasek

    Jan. 3, 2013

How to automate UI tests for Web and Native Apps on iOS and Android

Views

Total views

37,494

On Slideshare

0

From embeds

0

Number of embeds

1,436

Actions

Downloads

0

Shares

0

Comments

0

Likes

66

×