Session outline   Introduction   Simulator basics   Mobile end-to-end testing (Moet)   Building your mobile tests   D...
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=<mod...
Simulator commandsActions           StepsStart 9630 Tour   fledge.exe /app=jvm.dllsimulator            /session=9630 /hand...
bblib.pyActions           Steps                                  bblib.pyStart 9630 Tour   fledge.exe /app=jvm.dll        ...
Simulator commandsAction         StepsEnter Hello   StringInjection(Hello)World         KeyPress(SPACE)               KeyR...
bblib.pyAction         Steps                           bblib.pyEnter Hello   StringInjection(Hello)          enter(‘Hello ...
Simulator Basics              TM   Android     Create AVD        $ANDROID_HOME/tools/android     Starting emulator     ...
Simulator commandAction         StepsEnter Hello   adb shellWorld         "sendevent /dev/input/event0 1 42 1;            ...
androidlib.pyAction         Steps                                   androidlib.pyEnter Hello   adb shell                  ...
Moet   Mobile end-to-End testing     Open sourced on github     Simulator libraries        androidlib.py        bblib.p...
Moet Framework            Mobile Application Interface              Device Independent Tests                      Runtime ...
Test Automation Overview1.   Define application interface     This interface is device-agnostic.2.   Implement the interfa...
Step 1 : Define app interfaceclass AppInterface: """ Application interface for all   devices to implement """  def add(sel...
Test Automation Overview1.   Define application interface     This interface is device-agnostic.2.   Implement the interfa...
Step 2 (Pearl) :Implement the interfacedef add(self, contact):   """ Add contact """   # click add contact   enter()   # e...
Step 2 (Android) :Implement the interfacedef add(self, contact):   """ Add contact """   # click add contact   menu()   sc...
Step 2 (recap) :Implement the interfacedef PearlImpl(appbase.AppInterface):   def AndroidImpl(appbase.AppInterface):    de...
Test Automation Overview1.   Define application interface     This interface is device-agnostic.2.   Implement the interfa...
Step 3 : Writing testsclass AddContactTest(unittest.TestCase):   device = testenv.getDeviceClass()   def addContactWithOnl...
Step 3 : Runtime bindingdef getDeviceClass(self):    """ Returns the device to test """   mobileDevice = self.getMobileDev...
More device-independent testsAdditional tests are easy to write    def addContactWithEmailTest(self):    def addContactWit...
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.assertT...
Test Logging   Logs    AddressTest.log :    2010-06-10 15:19:46,773 - testCreateAddressMethod - INFO -       [Address] 20...
Demo   Simulators     Android     BlackBerry Pearl Moet Test automation     Address book app      ○ Add contact     ...
Advantages   Low cost and ease of use   Reusable end-to-end tests   No device sharing/scheduling   Bigger device pool...
Limitations   Requires ethernet or internet connectivity   Does not simulate network performance   Does not support har...
ResourcesMoet http://github.com/moet/moet/Android      Emulator http://developer.android.com/guide/developing/tools/emula...
Q&A
2011 py con
2011 py con
Upcoming SlideShare
Loading in …5
×

2011 py con

307
-1

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
307
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

2011 py con

  1. 1. Session outline Introduction Simulator basics Mobile end-to-end testing (Moet) Building your mobile tests Demo Advantages and limitations Q&A
  2. 2. What are we solving for Diverse mobile platforms Low cost solution End-to-end mobile tests Leverage black box testers
  3. 3. 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>
  4. 4. Simulator commandsActions StepsStart 9630 Tour fledge.exe /app=jvm.dllsimulator /session=9630 /handheld=9630 /app- param=JvmAlxConfigFile:9630.xmlInstall 1. Copy app.jar, app.jad, app.cod toapplication Javaloader directory 2. JavaLoader.exe –u load app.jad 3. Delete app.jar, app.jad, app.codSave screenshot 1. JavaLoader.exe –u screenshotas test.png in test.png$TEST_OUTPUT 2. mv test.png $TEST_OUTPUT
  5. 5. bblib.pyActions Steps bblib.pyStart 9630 Tour fledge.exe /app=jvm.dll fledgeStart()simulator /session=9630 /handheld=9630 /app- param=JvmAlxConfigFile:9630.xmlInstall 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.codSave screenshot 1. JavaLoader.exe –u screenshot screenshot(‘test’)as test.png in test.png$TEST_OUTPUT 2. mv test.png $TEST_OUTPUT
  6. 6. Simulator commandsAction StepsEnter 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)
  7. 7. bblib.pyAction Steps bblib.pyEnter 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)
  8. 8. Simulator Basics TM Android  Create AVD $ANDROID_HOME/tools/android  Starting emulator emulator –avd <avd>  Communicating with emulator adb shell
  9. 9. Simulator commandAction StepsEnter Hello adb shellWorld "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; …"
  10. 10. androidlib.pyAction Steps androidlib.pyEnter Hello adb shell enter(‘HelloWorld 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. 11. Moet Mobile end-to-End testing  Open sourced on github  Simulator libraries androidlib.py bblib.py  Image processing library imagelib.py  Testing utilities library testlib.py logger.py
  12. 12. Moet Framework Mobile Application Interface Device Independent Tests Runtime bindingSimulator libraries Android app library BlackBerry app library androidlib.py bblib.py
  13. 13. Test Automation Overview1. 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
  14. 14. Step 1 : Define app interfaceclass 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"""
  15. 15. Test Automation Overview1. 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
  16. 16. Step 2 (Pearl) :Implement the interfacedef add(self, contact): """ Add contact """ # click add contact enter() # enter name enter(contact.getFirstname() thumbwheel(down, 1) … # save menu() enter()
  17. 17. Step 2 (Android) :Implement the interfacedef 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()
  18. 18. Step 2 (recap) :Implement the interfacedef 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()
  19. 19. Test Automation Overview1. 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
  20. 20. Step 3 : Writing testsclass 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)
  21. 21. Step 3 : Runtime bindingdef 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
  22. 22. More device-independent testsAdditional 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):
  23. 23. Step 4 : Run Basic run command  python <test.py> Python test frameworks  unittest  PyUnit  python-nose
  24. 24. 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
  25. 25. 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’)
  26. 26. Demo Simulators  Android  BlackBerry Pearl Moet Test automation  Address book app ○ Add contact ○ Find contact ○ Delete contact
  27. 27. 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
  28. 28. 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
  29. 29. ResourcesMoet http://github.com/moet/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.htmlBlackBerry  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/
  30. 30. Q&A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×