SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Innovative Tools for Your
Mobile Testing Toolkit

Eing Ong
Staff Software Engineer in Quality, Intuit, Inc.
Session outline

¤ Test automation technologies
¤ Innovative technologies
  •    User behavior – Sikuli
  •    Device SDK tool - MonkeyRunner
  •    Image processing – ImageMagick
  •    Design patterns – MOET

¤ Demo
¤ Q & A
Native mobile apps automation

¤ Two categories
  •  Instrumented technique
  •  Non-instrumented technique

¤ What is instrumentation
  •    Test project is compiled with the app
  •    Tests are installed and launched with the app
  •    Source code is required and may be modified
  •    Only one application can be tested at a time
  •    White box approach
Advantages of both techniques

  Non-instrumentation                    Instrumentation
•  Device platform agnostic     •    Elements can be accessed
•  Test code reuse              •    Debugging ease
•  Test language and test       •    Test verification ease
   harness autonomy             •    Reduce tools dependencies
•  Support for                  •    Support for
   Multi-applications testing        Installing application
   Custom UI elements                Launching application
   Database/API assertions           Kill application
   Use of external libraries         Test execution on device
   (e.g. image manipulation)         Code coverage
Which technique should I use ?
Non-instrumentation              Instrumentation

                  External
                interaction
       Hardware                 Text-
      interaction              based
                Image         features
                based
               features
Open sourced tools

Mobile           Non-          Instrumentation
 OS        instrumentation
Android Sikuli, MOET,        Robotium, MonkeyTalk,
        MonkeyRunner         Calabash

  iOS    Sikuli, MOET        KIF, UISpec, Frank,
                             Calabash, iCuke,
                             Zucchini, Bwoken,
                             MonkeyTalk
Sikuli : User behavior innovation

¤  Visual technology to automate and test GUI using
    images – sikuli.org
¤  Platform and OS agnostic
     •  Controls on desktop
     •  Controls mobile simulators and devices (via VNC)

¤  Actions
       •    Gestures, keystrokes
       •    Captures screenshots
       •    Detects screen changes
       •    Finds image, image OCR
Customizing Sikuli for iPhone

Customized API            Sikuli API
touch(int x, int y)       click(new Location(x,y), 0)
enter(String str)         type(null, str, 0)
touchImage(String im)     click(“homebutton.png”, 0)
screenshot(String file)   capture(region.getRect())
getText()                 region.text();
home()                    keyDown(Key.SHIFT);
                          keyDown(Key.META);
                          keyDown("h");
                          keyUp(Key.META);
                          keyUp(Key.SHIFT);
                          keyUp("h");
Example

import com.intuit.moet.iPhone;

void login (username, password)
    touch (“30%”, “40%”);
    backspaces (20);
    enter(username);
    touchImage(iPhone.KeyNext);
    enter(password);
    touchImage(iPhone.KeyGo);


Customized APIs from com.intuit.moet.iPhone.java (github.com/eing/moet)
MonkeyRunner :
Device SDK tool innovation

¤  API for controlling an Android device/emulator
    outside of Android code - developer.android.com

¤  Actions
    •  Multiple emulators & devices interaction
    •  Captures screenshots
    •  Send keystrokes, gestures
    •  Start/stop/reconnect emulator
    •  Configure logging


                                                      10
Using MonkeyRunner

  Customized API             MonkeyRunner API
  touch(int x, int y)        touch(x, y,
                             TouchPressType.DOWN_AND_UP);
  backspaces(int num)        while (num > 0)
                              device.press(KEYCODE_DEL, …);
                              num--;
  screenshot(String file)    image = takeSnapshot();
                             image.writeToFile(filename, "png");
  home()                     press(KEYCODE_HOME,
                             TouchPressType.DOWN_AND_UP);
  launch(String activity)    shell(" am start -n " + activity);

Customized APIs from com.intuit.moet.Android.java (github.com/eing/moet)
ImageMagick ® :
 Image processing innovation

¤  Software suite to create, edit, compose, or convert
    bitmap images – imagemagick.org
¤  Actions
     •  Resize, flip, mirror, rotate, distort
     •  Transform images, adjust image colors
     •  Format conversion, draw, captions

¤  Supports
     •  Windows, Unix, Mac, and iOS
     •  C, C++, Perl APIs
Customizing ImageMagick for mobile

¤  crop (String crop, int resX, int resY)
      crop(“200x100+10+10”, 480, 800)
      crop(“50%x100%)
      crop(“50%x50%+10%+10%”, 320, 480)

¤  boolean compare(String image, int tolerance)
      compare(“HomeScreen.png”, 200)

¤  boolean waitForScreenChange(String image)
      waitForScreenChange(“CurrentImage.png”)


Customized APIs from com.intuit.moet.ImageKit.java
MOET : Design patterns innovation
                                Test
¤ Think Design                   login(‘user1’,’passwd1’)

  •  Interfaces                  iPhone implementation
  •  Creational pattern              touch(100,100)
                                     enter(username)
¤ Think Reuse
                                     touch(100,200)
  •  Device independent tests        enter(password)
                                     touch(150, 300)
¤ Think One
                                 iPhone library
  •  Test language & harness
                                     void enter()
                                     void touch(x,y)
Test architecture using MOET

            Mobile Application Interface


            Device Independent Tests
                      Runtime binding
Simulator libraries
  Android application             iPhone application
    implementation                  implementation
 Android MonkeyRunner
                                  iPhone Sikuli Library
         Library
Add contact test

class AddContactTest() :
  public void addContactWithOnlyFirstnameTest() {
    Contact contact = new Contact(firstname, null);
     assertTrue(device.addContact(contact));
  }
  public void addContactWithOnlyLastnameTest() {
    Contact contact = new Contact(null, lastname);
     assertTrue(device.addContact(contact));
  }
Android implementation

public class AndroidImpl implements IAddressBookApp {
       private Android device;
       public boolean addContact(Contact contact) {
              device.menu();
              device.scroll(“down”);
              device.enter(contact.getFirstname());
              device.scroll(“down”);
              device.enter(contact.getLastname());
              … enter other fields…
              device.enter();
iPhone implementation

public class iPhoneImpl implements IAddressBookApp {
       private iPhone device;
       public boolean addContact(Contact contact) {
               device.touch("First");
               device.enter(contact.getFirstname())
               device.touch("Last");
               device.enter(contact.getLastname());
               device.scroll(“down”)
               … enter other fields …
               device.touchImage("ButtonDone.png");z
Demo

¤  Test reused and executed on
    Android & iOS

¤ Using Sikuli, ImageMagick, MOET
   and MonkeyRunner on Android

¤  Automate address book app
  •  Add contact
  •  Find contact
  •  Delete contact
Resources

¤  Sikuli           http://sikuli.org

¤  MonkeyRunner http://developer.android.com/tools/help/index.html

¤  ImageMagick      http://www.imagemagick.org

¤  MOET            https://github.com/eing/moet

¤  Other open sourced tools grouped by language
    ¤  ObjectiveC - KIF
    ¤  Java - Robotium, MonkeyRunner
    ¤  Ruby - UISpec
    ¤  Coffeescript - Zucchini, Bwoken
    ¤  Cucumber - Calabash, iCuke, Frank
    ¤  MonkeyTalk - MonkeyTalk
Q&A
Thank you

¤ Thank you for submitting your feedback !

¤ For more details on the presentation, please
   contact @eingong / eing.ong@intuit.com

Más contenido relacionado

Similar a 2012 star west-t10

Selenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testingSelenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testingIsaac Murchie
 
Mobile developer is Software developer
Mobile developer is Software developerMobile developer is Software developer
Mobile developer is Software developerEugen Martynov
 
Xamarin UI Test And Xamarin Test Cloud
Xamarin UI Test And Xamarin Test CloudXamarin UI Test And Xamarin Test Cloud
Xamarin UI Test And Xamarin Test CloudEmanuel Amiguinho
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouchJonas Follesø
 
Cross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToCross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToGlobalLogic Ukraine
 
Appcelerator Titanium at Mobile 2.0
Appcelerator Titanium at Mobile 2.0Appcelerator Titanium at Mobile 2.0
Appcelerator Titanium at Mobile 2.0Jeff Haynie
 
Mobile 2.0 Event: Mobile for the rest of us using Appcelerator Titanium
Mobile 2.0 Event: Mobile for the rest of us using Appcelerator TitaniumMobile 2.0 Event: Mobile for the rest of us using Appcelerator Titanium
Mobile 2.0 Event: Mobile for the rest of us using Appcelerator TitaniumJeff Haynie
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodepCloudy
 
Rockstar Android Testing (Mobile TechCon Munich 2014)
Rockstar Android Testing (Mobile TechCon Munich 2014)Rockstar Android Testing (Mobile TechCon Munich 2014)
Rockstar Android Testing (Mobile TechCon Munich 2014)Danny Preussler
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularTodd Anglin
 
Mobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ieMobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ieDavid O'Dowd
 
Scott Mason: Enhancing the User Interface Using Titanium Modules
Scott Mason: Enhancing the User Interface Using Titanium ModulesScott Mason: Enhancing the User Interface Using Titanium Modules
Scott Mason: Enhancing the User Interface Using Titanium ModulesAxway Appcelerator
 
Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017Xamarin
 
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...
Velocity Conference: Increasing Speed To Market In Mobile Development Through...Intuit Inc.
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building AndroidDroidcon Berlin
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumAxway Appcelerator
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAJeff Haynie
 
Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Bitbar
 

Similar a 2012 star west-t10 (20)

Selenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testingSelenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testing
 
Mobile developer is Software developer
Mobile developer is Software developerMobile developer is Software developer
Mobile developer is Software developer
 
Xamarin UI Test And Xamarin Test Cloud
Xamarin UI Test And Xamarin Test CloudXamarin UI Test And Xamarin Test Cloud
Xamarin UI Test And Xamarin Test Cloud
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
 
Cross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToCross Platform Appium Tests: How To
Cross Platform Appium Tests: How To
 
Mobile for the rest of us
Mobile for the rest of usMobile for the rest of us
Mobile for the rest of us
 
Appcelerator Titanium at Mobile 2.0
Appcelerator Titanium at Mobile 2.0Appcelerator Titanium at Mobile 2.0
Appcelerator Titanium at Mobile 2.0
 
Mobile 2.0 Event: Mobile for the rest of us using Appcelerator Titanium
Mobile 2.0 Event: Mobile for the rest of us using Appcelerator TitaniumMobile 2.0 Event: Mobile for the rest of us using Appcelerator Titanium
Mobile 2.0 Event: Mobile for the rest of us using Appcelerator Titanium
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with Xcode
 
Rockstar Android Testing (Mobile TechCon Munich 2014)
Rockstar Android Testing (Mobile TechCon Munich 2014)Rockstar Android Testing (Mobile TechCon Munich 2014)
Rockstar Android Testing (Mobile TechCon Munich 2014)
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
 
Mobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ieMobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ie
 
Scott Mason: Enhancing the User Interface Using Titanium Modules
Scott Mason: Enhancing the User Interface Using Titanium ModulesScott Mason: Enhancing the User Interface Using Titanium Modules
Scott Mason: Enhancing the User Interface Using Titanium Modules
 
Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017
 
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...
Velocity Conference: Increasing Speed To Market In Mobile Development Through...
 
Eco system apps
Eco system appsEco system apps
Eco system apps
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with Titanium
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
 
Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?
 

Último

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Último (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

2012 star west-t10

  • 1. Innovative Tools for Your Mobile Testing Toolkit Eing Ong Staff Software Engineer in Quality, Intuit, Inc.
  • 2. Session outline ¤ Test automation technologies ¤ Innovative technologies •  User behavior – Sikuli •  Device SDK tool - MonkeyRunner •  Image processing – ImageMagick •  Design patterns – MOET ¤ Demo ¤ Q & A
  • 3. Native mobile apps automation ¤ Two categories •  Instrumented technique •  Non-instrumented technique ¤ What is instrumentation •  Test project is compiled with the app •  Tests are installed and launched with the app •  Source code is required and may be modified •  Only one application can be tested at a time •  White box approach
  • 4. Advantages of both techniques Non-instrumentation Instrumentation •  Device platform agnostic •  Elements can be accessed •  Test code reuse •  Debugging ease •  Test language and test •  Test verification ease harness autonomy •  Reduce tools dependencies •  Support for •  Support for Multi-applications testing Installing application Custom UI elements Launching application Database/API assertions Kill application Use of external libraries Test execution on device (e.g. image manipulation) Code coverage
  • 5. Which technique should I use ? Non-instrumentation Instrumentation External interaction Hardware Text- interaction based Image features based features
  • 6. Open sourced tools Mobile Non- Instrumentation OS instrumentation Android Sikuli, MOET, Robotium, MonkeyTalk, MonkeyRunner Calabash iOS Sikuli, MOET KIF, UISpec, Frank, Calabash, iCuke, Zucchini, Bwoken, MonkeyTalk
  • 7. Sikuli : User behavior innovation ¤  Visual technology to automate and test GUI using images – sikuli.org ¤  Platform and OS agnostic •  Controls on desktop •  Controls mobile simulators and devices (via VNC) ¤  Actions •  Gestures, keystrokes •  Captures screenshots •  Detects screen changes •  Finds image, image OCR
  • 8. Customizing Sikuli for iPhone Customized API Sikuli API touch(int x, int y) click(new Location(x,y), 0) enter(String str) type(null, str, 0) touchImage(String im) click(“homebutton.png”, 0) screenshot(String file) capture(region.getRect()) getText() region.text(); home() keyDown(Key.SHIFT); keyDown(Key.META); keyDown("h"); keyUp(Key.META); keyUp(Key.SHIFT); keyUp("h");
  • 9. Example import com.intuit.moet.iPhone; void login (username, password) touch (“30%”, “40%”); backspaces (20); enter(username); touchImage(iPhone.KeyNext); enter(password); touchImage(iPhone.KeyGo); Customized APIs from com.intuit.moet.iPhone.java (github.com/eing/moet)
  • 10. MonkeyRunner : Device SDK tool innovation ¤  API for controlling an Android device/emulator outside of Android code - developer.android.com ¤  Actions •  Multiple emulators & devices interaction •  Captures screenshots •  Send keystrokes, gestures •  Start/stop/reconnect emulator •  Configure logging 10
  • 11. Using MonkeyRunner Customized API MonkeyRunner API touch(int x, int y) touch(x, y, TouchPressType.DOWN_AND_UP); backspaces(int num) while (num > 0) device.press(KEYCODE_DEL, …); num--; screenshot(String file) image = takeSnapshot(); image.writeToFile(filename, "png"); home() press(KEYCODE_HOME, TouchPressType.DOWN_AND_UP); launch(String activity) shell(" am start -n " + activity); Customized APIs from com.intuit.moet.Android.java (github.com/eing/moet)
  • 12. ImageMagick ® : Image processing innovation ¤  Software suite to create, edit, compose, or convert bitmap images – imagemagick.org ¤  Actions •  Resize, flip, mirror, rotate, distort •  Transform images, adjust image colors •  Format conversion, draw, captions ¤  Supports •  Windows, Unix, Mac, and iOS •  C, C++, Perl APIs
  • 13. Customizing ImageMagick for mobile ¤  crop (String crop, int resX, int resY) crop(“200x100+10+10”, 480, 800) crop(“50%x100%) crop(“50%x50%+10%+10%”, 320, 480) ¤  boolean compare(String image, int tolerance) compare(“HomeScreen.png”, 200) ¤  boolean waitForScreenChange(String image) waitForScreenChange(“CurrentImage.png”) Customized APIs from com.intuit.moet.ImageKit.java
  • 14. MOET : Design patterns innovation Test ¤ Think Design login(‘user1’,’passwd1’) •  Interfaces iPhone implementation •  Creational pattern touch(100,100) enter(username) ¤ Think Reuse touch(100,200) •  Device independent tests enter(password) touch(150, 300) ¤ Think One iPhone library •  Test language & harness void enter() void touch(x,y)
  • 15. Test architecture using MOET Mobile Application Interface Device Independent Tests Runtime binding Simulator libraries Android application iPhone application implementation implementation Android MonkeyRunner iPhone Sikuli Library Library
  • 16. Add contact test class AddContactTest() : public void addContactWithOnlyFirstnameTest() { Contact contact = new Contact(firstname, null); assertTrue(device.addContact(contact)); } public void addContactWithOnlyLastnameTest() { Contact contact = new Contact(null, lastname); assertTrue(device.addContact(contact)); }
  • 17. Android implementation public class AndroidImpl implements IAddressBookApp { private Android device; public boolean addContact(Contact contact) { device.menu(); device.scroll(“down”); device.enter(contact.getFirstname()); device.scroll(“down”); device.enter(contact.getLastname()); … enter other fields… device.enter();
  • 18. iPhone implementation public class iPhoneImpl implements IAddressBookApp { private iPhone device; public boolean addContact(Contact contact) { device.touch("First"); device.enter(contact.getFirstname()) device.touch("Last"); device.enter(contact.getLastname()); device.scroll(“down”) … enter other fields … device.touchImage("ButtonDone.png");z
  • 19. Demo ¤  Test reused and executed on Android & iOS ¤ Using Sikuli, ImageMagick, MOET and MonkeyRunner on Android ¤  Automate address book app •  Add contact •  Find contact •  Delete contact
  • 20. Resources ¤  Sikuli http://sikuli.org ¤  MonkeyRunner http://developer.android.com/tools/help/index.html ¤  ImageMagick http://www.imagemagick.org ¤  MOET https://github.com/eing/moet ¤  Other open sourced tools grouped by language ¤  ObjectiveC - KIF ¤  Java - Robotium, MonkeyRunner ¤  Ruby - UISpec ¤  Coffeescript - Zucchini, Bwoken ¤  Cucumber - Calabash, iCuke, Frank ¤  MonkeyTalk - MonkeyTalk
  • 21. Q&A
  • 22. Thank you ¤ Thank you for submitting your feedback ! ¤ For more details on the presentation, please contact @eingong / eing.ong@intuit.com