SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
Session outline

   Introduction
   Simulator basics
   Mobile end-to-end testing (Moet)
   Building your mobile tests
   Demo
   Advantages and limitations
   Q&A
What are we solving for

 Diverse mobile platforms
 Low cost solution
 End-to-end mobile tests
 Leverage black box testers
Simulator Basics

   BlackBerry TM
     Starting simulator
        fledge.exe
           /app=jvm.dll
           /session=<model>
           /app-param=
               JvmAlxConfigFile:<model>.xml
           /handheld=<model>

     Communicating with simulator
        fledgecontroller.exe /session=<model>
Simulator commands
Actions           Steps
Start 9630 Tour   fledge.exe /app=jvm.dll
simulator            /session=9630 /handheld=9630
                     /app-
                     param=JvmAlxConfigFile:9630.xml
Install           1. Copy app.jar, app.jad, app.cod to
application          Javaloader directory
                  2. JavaLoader.exe –u load app.jad
                3. Delete app.jar, app.jad, app.cod
Save screenshot 1. JavaLoader.exe –u screenshot
as test.png in     test.png
$TEST_OUTPUT
                  2. mv test.png $TEST_OUTPUT
bblib.py
Actions           Steps                                  bblib.py
Start 9630 Tour   fledge.exe /app=jvm.dll                fledgeStart()
simulator            /session=9630 /handheld=9630
                     /app-
                     param=JvmAlxConfigFile:9630.xml
Install           1. Copy app.jar, app.jad, app.cod to   install()
application          Javaloader directory
                  2. JavaLoader.exe –u load app.jad
                3. Delete app.jar, app.jad, app.cod
Save screenshot 1. JavaLoader.exe –u screenshot          screenshot(‘test’)
as test.png in     test.png
$TEST_OUTPUT
                  2. mv test.png $TEST_OUTPUT
Simulator commands
Action         Steps
Enter 'Hello   StringInjection(Hello)
World'         KeyPress(SPACE)
               KeyRelease(SPACE)
                StringInjection(World)
Touch screen at TouchScreenPress(10, 100, 0)
(10, 100)       TouchScreenClick()
                TouchScreenUnclick()
                TouchScreenUnpress(0)
Thumbwheel up ThumbWheelRoll(-1)
twice          ThumbWheelRoll(-1)
bblib.py
Action         Steps                           bblib.py
Enter 'Hello   StringInjection(Hello)          enter(‘Hello World')
World'         KeyPress(SPACE)
               KeyRelease(SPACE)
                StringInjection(World)
Touch screen at TouchScreenPress(10, 100, 0)   touch(10, 100)
(10, 100)       TouchScreenClick()
                TouchScreenUnclick()
                TouchScreenUnpress(0)
Thumbwheel up ThumbWheelRoll(-1)               thumbwheel ('up',
twice          ThumbWheelRoll(-1)                           2)
Simulator Basics
              TM
   Android
     Create AVD
        $ANDROID_HOME/tools/android


     Starting emulator
        emulator –avd <avd>


     Communicating with emulator
        adb shell
Simulator command
Action         Steps
Enter 'Hello   adb shell
World'         "sendevent /dev/input/event0 1 42 1;
                 sendevent /dev/input/event0 1 42 0;
                 sendevent /dev/input/event0 1 35 1;
                 sendevent /dev/input/event0 1 35 0;
                 sendevent /dev/input/event0 1 18 1;
                 sendevent /dev/input/event0 1 18 0;
                 sendevent /dev/input/event0 1 38 1;
                 sendevent /dev/input/event0 1 38 0;
                 sendevent /dev/input/event0 1 38 1;
                 sendevent /dev/input/event0 1 38 0;
                 sendevent /dev/input/event0 1 24 1;
                 sendevent /dev/input/event0 1 24 0;
               …"
androidlib.py
Action         Steps                                   androidlib.py
Enter 'Hello   adb shell                               enter(‘Hello
World'                                                   World’)
               "sendevent /dev/input/event0 1 42 1;
                 sendevent /dev/input/event0 1 42 0;
                 sendevent /dev/input/event0 1 35 1;
                 sendevent /dev/input/event0 1 35 0;
                 sendevent /dev/input/event0 1 18 1;
                 sendevent /dev/input/event0 1 18 0;
                 sendevent /dev/input/event0 1 38 1;
                 sendevent /dev/input/event0 1 38 0;
                 sendevent /dev/input/event0 1 38 1;
                 sendevent /dev/input/event0 1 38 0;
                 sendevent /dev/input/event0 1 24 1;
                 sendevent /dev/input/event0 1 24 0;
               …"
MOET

   MObile End-to-End Test

     Simulator libraries
        androidlib.py
        bblib.py
     Image processing library
        imagelib.py
     Testing utilities library
        testlib.py
        logger.py
Moet Framework

            Mobile Application Interface


              Device Independent Tests
                      Runtime binding
Simulator libraries


    Android app library        BlackBerry app library

       androidlib.py                    bblib.py
Test Automation Overview

1.   Define application interface
     This interface is device-agnostic.


2.   Implement the interface
     Implement the interface in your supported devices e.g. Android.
     Utilize python mobile libraries e.g. androidlib.py.


3.   Write your tests
     Tests are device independent and reusable on all supported devices.


4.   Run
Step 1 : Define app interface

class AppInterface:
 """ Application interface for all
   devices to implement """

  def add(self, contact):
    """Add contact """

  def find(self, contact):
    """ Find contact"""

  def delete(self, contact):
    """Delete contact"""
Test Automation Overview

1.   Define application interface
     This interface is device-agnostic.


2.   Implement the interface
     Implement the interface in your supported devices.
     Utilize moet libraries.


3.   Write your tests
     Tests are device independent and reusable on all supported devices.


4.   Run
Step 2 (Pearl) :
Implement the interface

def add(self, contact):
   """ Add contact """

   # click add contact
   enter()

   # enter name
   enter(contact.getFirstname()
   thumbwheel('down', 1)
    …
   # save
   menu()
   enter()
Step 2 (Android) :
Implement the interface

def add(self, contact):
   """ Add contact """

   # click add contact
   menu()
   scroll(‘up’)
   scroll(‘right’)
   enter()

   # enter name
   enter(contact.getFirstname())
   scroll('down')
   …
   # save
   menu()
   scroll(‘down’)
    enter()
Step 2 (recap) :
Implement the interface

def PearlImpl(appbase.AppInterface):   def AndroidImpl(appbase.AppInterface):
    def add(self, contact):               def add(self, contact):
         """ Add contact """                   """ Add contact """
       enter()                                 menu()
       enter(contact.getFirstname()            scroll(‘up’)
       thumbwheel('down', 1)                   scroll(‘right’)
       …                                       enter()
       menu()                                  enter(contact.getFirstname())
       enter()                                 scroll(‘down’)
                                               …
                                              menu()
                                              scroll(‘down’)
                                              enter()
Test Automation Overview

1.   Define application interface
     This interface is device-agnostic.


2.   Implement the interface
     Implement the interface in your supported devices e.g. Android.
     Utilize python mobile libraries e.g. androidlib.py.


3.   Write your tests
     Tests are device independent and reusable on all supported devices.


4.   Run
Step 3 : Writing tests
class AddContactTest(unittest.TestCase):

   device = testenv.getDeviceClass()

   def addContactWithOnlyFirstnameTest(self):
     self.contact.setFirstname(firstname)
     self.device.add(self.contact)

   def addContactWithOnlyLastnameTest(self):
     self.contact.setLastname(lastname)
     self.device.add(self.contact)
Step 3 : Runtime binding
def getDeviceClass(self):
    """ Returns the device to test """

   mobileDevice = self.getMobileDevice()

   if mobileDevice == 'pearl':
         import pearl
         deviceClass = pearl.PearlImpl()

   elif mobileDevice == ‘android':
          import android
          deviceClass = android.AndroidImpl()

   return deviceClass
More device-independent tests

Additional tests are easy to write

    def addContactWithEmailTest(self):
    def addContactWithAddressesTest(self):
    def addContactWithAllDetailsTest(self):
    def addContactWithLongDetailsTest(self):
    def addContactAddressWithStateZip(self):
    def addContactAddressWithCityStateZip(self):
    def addContactAddressWithNoDataNegativeTest(self):
Step 4 : Run

   Basic run command
     python <test.py>


   Python test frameworks
     unittest
     PyUnit
     python-nose
Test Verification

   Server hosted apps
     API assertions
     Database assertions

   Image assertions
      self.assertTrue(
        imagelib.compare(
          self.device, testname, '100%x90%‘, tolerance))
            # Crop settings examples
            # 100%x80%+10%+20% (crop size + offset)
            # 320x90+0+0
            # +0+90
Test Logging

   Logs
    AddressTest.log :
    2010-06-10 15:19:46,773 - testCreateAddressMethod - INFO -
       [Address] 200 Villa St Mountain View CA 94040 BUSINESS ADDRESS


   Initialization
    self.log = self.device.initLogger(self._testMethodName,
                                      self.__class__.__name__)

   Usage
    self.log.info('Starting test: ' + self._testMethodName)
    self.log.debug(self.contact)
    self.log.error(‘Missing image to compare’)
Demo

   Simulators
     Android
     BlackBerry Pearl
 Moet
 Test automation
     Address book app
      ○ Add contact
      ○ Find contact
      ○ Delete contact
Advantages

   Low cost and ease of use
   Reusable end-to-end tests
   No device sharing/scheduling
   Bigger device pool
   Reduce manual testing time
   Run on developer machines
   Debugging capabilities
Limitations

   Requires ethernet or internet connectivity
   Does not simulate network performance
   Does not support hardware controls testing
   Dependent on simulator reliability
   Limited peer-to-peer applications testing
Resources
MOET http://github.com/eing/moet/
Android 

     Emulator http://developer.android.com/guide/developing/tools/emulator.html

     ADB http://android-dls.com/wiki/index.php?title=ADB

     Forum http://developer.android.com/resources/community-groups.html

BlackBerry 
     Downloads http://na.blackberry.com/eng/developers/javaappdev/javadevenv.jsp
     Fledge Controller
          http://docs.blackberry.com/en/developers/deliverables/6338/Testing_apps_using_the_
          BBSmrtphnSmltr_607559_11.jsp

     Forum http://supportforums.blackberry.com/
Q&A
Moet - Mobile End-to-End Test at Selenium Conf 2011

Contenu connexe

Dernier

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Dernier (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 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!
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Moet - Mobile End-to-End Test at Selenium Conf 2011

  • 1.
  • 2. Session outline  Introduction  Simulator basics  Mobile end-to-end testing (Moet)  Building your mobile tests  Demo  Advantages and limitations  Q&A
  • 3. What are we solving for  Diverse mobile platforms  Low cost solution  End-to-end mobile tests  Leverage black box testers
  • 4. Simulator Basics  BlackBerry TM  Starting simulator fledge.exe /app=jvm.dll /session=<model> /app-param= JvmAlxConfigFile:<model>.xml /handheld=<model>  Communicating with simulator fledgecontroller.exe /session=<model>
  • 5. Simulator commands Actions Steps Start 9630 Tour fledge.exe /app=jvm.dll simulator /session=9630 /handheld=9630 /app- param=JvmAlxConfigFile:9630.xml Install 1. Copy app.jar, app.jad, app.cod to application Javaloader directory 2. JavaLoader.exe –u load app.jad 3. Delete app.jar, app.jad, app.cod Save screenshot 1. JavaLoader.exe –u screenshot as test.png in test.png $TEST_OUTPUT 2. mv test.png $TEST_OUTPUT
  • 6. bblib.py Actions Steps bblib.py Start 9630 Tour fledge.exe /app=jvm.dll fledgeStart() simulator /session=9630 /handheld=9630 /app- param=JvmAlxConfigFile:9630.xml Install 1. Copy app.jar, app.jad, app.cod to install() application Javaloader directory 2. JavaLoader.exe –u load app.jad 3. Delete app.jar, app.jad, app.cod Save screenshot 1. JavaLoader.exe –u screenshot screenshot(‘test’) as test.png in test.png $TEST_OUTPUT 2. mv test.png $TEST_OUTPUT
  • 7. Simulator commands Action Steps Enter 'Hello StringInjection(Hello) World' KeyPress(SPACE) KeyRelease(SPACE) StringInjection(World) Touch screen at TouchScreenPress(10, 100, 0) (10, 100) TouchScreenClick() TouchScreenUnclick() TouchScreenUnpress(0) Thumbwheel up ThumbWheelRoll(-1) twice ThumbWheelRoll(-1)
  • 8. bblib.py Action Steps bblib.py Enter 'Hello StringInjection(Hello) enter(‘Hello World') World' KeyPress(SPACE) KeyRelease(SPACE) StringInjection(World) Touch screen at TouchScreenPress(10, 100, 0) touch(10, 100) (10, 100) TouchScreenClick() TouchScreenUnclick() TouchScreenUnpress(0) Thumbwheel up ThumbWheelRoll(-1) thumbwheel ('up', twice ThumbWheelRoll(-1) 2)
  • 9. Simulator Basics TM  Android  Create AVD $ANDROID_HOME/tools/android  Starting emulator emulator –avd <avd>  Communicating with emulator adb shell
  • 10. Simulator command Action Steps Enter 'Hello adb shell World' "sendevent /dev/input/event0 1 42 1; sendevent /dev/input/event0 1 42 0; sendevent /dev/input/event0 1 35 1; sendevent /dev/input/event0 1 35 0; sendevent /dev/input/event0 1 18 1; sendevent /dev/input/event0 1 18 0; sendevent /dev/input/event0 1 38 1; sendevent /dev/input/event0 1 38 0; sendevent /dev/input/event0 1 38 1; sendevent /dev/input/event0 1 38 0; sendevent /dev/input/event0 1 24 1; sendevent /dev/input/event0 1 24 0; …"
  • 11. androidlib.py Action Steps androidlib.py Enter 'Hello adb shell enter(‘Hello World' World’) "sendevent /dev/input/event0 1 42 1; sendevent /dev/input/event0 1 42 0; sendevent /dev/input/event0 1 35 1; sendevent /dev/input/event0 1 35 0; sendevent /dev/input/event0 1 18 1; sendevent /dev/input/event0 1 18 0; sendevent /dev/input/event0 1 38 1; sendevent /dev/input/event0 1 38 0; sendevent /dev/input/event0 1 38 1; sendevent /dev/input/event0 1 38 0; sendevent /dev/input/event0 1 24 1; sendevent /dev/input/event0 1 24 0; …"
  • 12. MOET  MObile End-to-End Test  Simulator libraries androidlib.py bblib.py  Image processing library imagelib.py  Testing utilities library testlib.py logger.py
  • 13. Moet Framework Mobile Application Interface Device Independent Tests Runtime binding Simulator libraries Android app library BlackBerry app library androidlib.py bblib.py
  • 14.
  • 15. Test Automation Overview 1. Define application interface This interface is device-agnostic. 2. Implement the interface Implement the interface in your supported devices e.g. Android. Utilize python mobile libraries e.g. androidlib.py. 3. Write your tests Tests are device independent and reusable on all supported devices. 4. Run
  • 16. Step 1 : Define app interface class AppInterface: """ Application interface for all devices to implement """ def add(self, contact): """Add contact """ def find(self, contact): """ Find contact""" def delete(self, contact): """Delete contact"""
  • 17. Test Automation Overview 1. Define application interface This interface is device-agnostic. 2. Implement the interface Implement the interface in your supported devices. Utilize moet libraries. 3. Write your tests Tests are device independent and reusable on all supported devices. 4. Run
  • 18. Step 2 (Pearl) : Implement the interface def add(self, contact): """ Add contact """ # click add contact enter() # enter name enter(contact.getFirstname() thumbwheel('down', 1) … # save menu() enter()
  • 19. Step 2 (Android) : Implement the interface def add(self, contact): """ Add contact """ # click add contact menu() scroll(‘up’) scroll(‘right’) enter() # enter name enter(contact.getFirstname()) scroll('down') … # save menu() scroll(‘down’) enter()
  • 20. Step 2 (recap) : Implement the interface def PearlImpl(appbase.AppInterface): def AndroidImpl(appbase.AppInterface): def add(self, contact): def add(self, contact): """ Add contact """ """ Add contact """ enter() menu() enter(contact.getFirstname() scroll(‘up’) thumbwheel('down', 1) scroll(‘right’) … enter() menu() enter(contact.getFirstname()) enter() scroll(‘down’) … menu() scroll(‘down’) enter()
  • 21. Test Automation Overview 1. Define application interface This interface is device-agnostic. 2. Implement the interface Implement the interface in your supported devices e.g. Android. Utilize python mobile libraries e.g. androidlib.py. 3. Write your tests Tests are device independent and reusable on all supported devices. 4. Run
  • 22. Step 3 : Writing tests class AddContactTest(unittest.TestCase): device = testenv.getDeviceClass() def addContactWithOnlyFirstnameTest(self): self.contact.setFirstname(firstname) self.device.add(self.contact) def addContactWithOnlyLastnameTest(self): self.contact.setLastname(lastname) self.device.add(self.contact)
  • 23. Step 3 : Runtime binding def getDeviceClass(self): """ Returns the device to test """ mobileDevice = self.getMobileDevice() if mobileDevice == 'pearl': import pearl deviceClass = pearl.PearlImpl() elif mobileDevice == ‘android': import android deviceClass = android.AndroidImpl() return deviceClass
  • 24. More device-independent tests Additional tests are easy to write def addContactWithEmailTest(self): def addContactWithAddressesTest(self): def addContactWithAllDetailsTest(self): def addContactWithLongDetailsTest(self): def addContactAddressWithStateZip(self): def addContactAddressWithCityStateZip(self): def addContactAddressWithNoDataNegativeTest(self):
  • 25. Step 4 : Run  Basic run command  python <test.py>  Python test frameworks  unittest  PyUnit  python-nose
  • 26. Test Verification  Server hosted apps  API assertions  Database assertions  Image assertions self.assertTrue( imagelib.compare( self.device, testname, '100%x90%‘, tolerance)) # Crop settings examples # 100%x80%+10%+20% (crop size + offset) # 320x90+0+0 # +0+90
  • 27. Test Logging  Logs AddressTest.log : 2010-06-10 15:19:46,773 - testCreateAddressMethod - INFO - [Address] 200 Villa St Mountain View CA 94040 BUSINESS ADDRESS  Initialization self.log = self.device.initLogger(self._testMethodName, self.__class__.__name__)  Usage self.log.info('Starting test: ' + self._testMethodName) self.log.debug(self.contact) self.log.error(‘Missing image to compare’)
  • 28. Demo  Simulators  Android  BlackBerry Pearl  Moet  Test automation  Address book app ○ Add contact ○ Find contact ○ Delete contact
  • 29. Advantages  Low cost and ease of use  Reusable end-to-end tests  No device sharing/scheduling  Bigger device pool  Reduce manual testing time  Run on developer machines  Debugging capabilities
  • 30. Limitations  Requires ethernet or internet connectivity  Does not simulate network performance  Does not support hardware controls testing  Dependent on simulator reliability  Limited peer-to-peer applications testing
  • 31. Resources MOET http://github.com/eing/moet/ Android  Emulator http://developer.android.com/guide/developing/tools/emulator.html ADB http://android-dls.com/wiki/index.php?title=ADB Forum http://developer.android.com/resources/community-groups.html BlackBerry  Downloads http://na.blackberry.com/eng/developers/javaappdev/javadevenv.jsp Fledge Controller http://docs.blackberry.com/en/developers/deliverables/6338/Testing_apps_using_the_ BBSmrtphnSmltr_607559_11.jsp Forum http://supportforums.blackberry.com/
  • 32. Q&A