SlideShare a Scribd company logo
Mobile Grid - Getting Started
Selenium Israel Meetup
November 25, 2015
The Mobile Grid
• Get test results as quickly as possible by parallelizing
your tests.
• Validate different operating systems version,
manufacturers, locales & screen sizes simultaneously.
• Capture critical metadata for reporting.
• Flexibility of accessing your devices locally via adb or
instruments.
• You don’t expose your app or sensitive data to the cloud.
What I’ll demo…
• Getting connected devices programmatically.
• Launching Grid & Appium nodes programmatically.
• Capturing video and logcat data for reporting.
• Running tests distributed.
• Running tests in parallel.
• Leveraging your test runs with cloud test services. e.g. Sauce Labs.
• Reduce your runtime costs by only executing selected scenarios.
• Generating the Allure report.
• Lets briefly look at the code…
Appium Server & Nodes Methods
ADB Methods (Video and Logcat)
Rake Task
Spec Helper
Spec Example
• Run the examples:
• Distributed: rake android[dist]
• https://www.dropbox.com/s/8md7ihp2i6pc5pw/distributed.mov?dl=0
• Parallel: rake android[parallel]
• https://www.dropbox.com/s/o7f6gb7chq51xya/parallel.mov?dl=0
• Distributed: rake android[dist,sauce] * run tests tagged :sauce in Sauce Labs.
• Generate the Allure report.
• allure generate report output/allure/*
• allure report open
• https://www.dropbox.com/s/a8g0erkabpa5zny/signup_failure.mov?dl=0
• Wunderlist Mobile Grid
• https://www.dropbox.com/s/y5xsmnxfldguzr0/grid-trimmed.mov?dl=0
• https://www.dropbox.com/s/675nonhixzq0ct7/emulators.mov?dl=0
Demo Time
Wunderlist Mobile Grid
• Mac Pro - 3.5 GHz 6-Core - 32 GB Ram.
• OSX Server with performance mode enabled.
• Two Anker 9 Port USB Hubs.
• Energenie programmable power strip. (Reboots hubs,
router, Mac)
• Blink(1) programmable usb light to display CI status.
• Jenkins - builds and runs smoke tests on every commit.
CI Machine Specs
Selenium Israel Meetup
Selenium Israel Meetup
That is great & all but reporting is key!
Challenges
• Adb disconnects.
• I solved this by programmatically rebooting USB hubs before every test run.
• WiFi disconnects.
• I solved this by toggling airplane mode on/off prior to every test run.
• Other Solutions:
• Reverse USB tethering. (requires rooting.)
• WiFi connection apps.
• Using multiple routers on different broadcasting channels.
• Spreading the devices apart.
• Alternatives to real devices:
• Android Studio emulators.
• Cannot video record. * I have a solution for this and will open source it.
• Emulators with VNC clients to record test sessions. (Facebook does this.)
• A big plus IMO is that you have access your apps local files (database) without rooting.
• Can use up a significant amount of memory depending on specs and the number running.
• Using Genymotion emulators. It’s the closest vm software to a real device.
• Has video recording but no API or CLI to start the recording. :/
• Using multiple Docker containers running emulator nodes. (Similar setup to the selenium web containers)
• Some devices just behave erratically. (random reboots, cannot connect to adb, wonky text output, battery issues)
Thank You!
• email: justin.ison@gmail.com
• twitter: @isonic1
• https://github.com/isonic1/selenium-conf-2015

More Related Content

Selenium Israel Meetup

  • 1. Mobile Grid - Getting Started Selenium Israel Meetup November 25, 2015
  • 2. The Mobile Grid • Get test results as quickly as possible by parallelizing your tests. • Validate different operating systems version, manufacturers, locales & screen sizes simultaneously. • Capture critical metadata for reporting. • Flexibility of accessing your devices locally via adb or instruments. • You don’t expose your app or sensitive data to the cloud.
  • 3. What I’ll demo… • Getting connected devices programmatically. • Launching Grid & Appium nodes programmatically. • Capturing video and logcat data for reporting. • Running tests distributed. • Running tests in parallel. • Leveraging your test runs with cloud test services. e.g. Sauce Labs. • Reduce your runtime costs by only executing selected scenarios. • Generating the Allure report. • Lets briefly look at the code…
  • 4. Appium Server & Nodes Methods
  • 5. ADB Methods (Video and Logcat)
  • 9. • Run the examples: • Distributed: rake android[dist] • https://www.dropbox.com/s/8md7ihp2i6pc5pw/distributed.mov?dl=0 • Parallel: rake android[parallel] • https://www.dropbox.com/s/o7f6gb7chq51xya/parallel.mov?dl=0 • Distributed: rake android[dist,sauce] * run tests tagged :sauce in Sauce Labs. • Generate the Allure report. • allure generate report output/allure/* • allure report open • https://www.dropbox.com/s/a8g0erkabpa5zny/signup_failure.mov?dl=0 • Wunderlist Mobile Grid • https://www.dropbox.com/s/y5xsmnxfldguzr0/grid-trimmed.mov?dl=0 • https://www.dropbox.com/s/675nonhixzq0ct7/emulators.mov?dl=0 Demo Time
  • 11. • Mac Pro - 3.5 GHz 6-Core - 32 GB Ram. • OSX Server with performance mode enabled. • Two Anker 9 Port USB Hubs. • Energenie programmable power strip. (Reboots hubs, router, Mac) • Blink(1) programmable usb light to display CI status. • Jenkins - builds and runs smoke tests on every commit. CI Machine Specs
  • 14. That is great & all but reporting is key!
  • 15. Challenges • Adb disconnects. • I solved this by programmatically rebooting USB hubs before every test run. • WiFi disconnects. • I solved this by toggling airplane mode on/off prior to every test run. • Other Solutions: • Reverse USB tethering. (requires rooting.) • WiFi connection apps. • Using multiple routers on different broadcasting channels. • Spreading the devices apart. • Alternatives to real devices: • Android Studio emulators. • Cannot video record. * I have a solution for this and will open source it. • Emulators with VNC clients to record test sessions. (Facebook does this.) • A big plus IMO is that you have access your apps local files (database) without rooting. • Can use up a significant amount of memory depending on specs and the number running. • Using Genymotion emulators. It’s the closest vm software to a real device. • Has video recording but no API or CLI to start the recording. :/ • Using multiple Docker containers running emulator nodes. (Similar setup to the selenium web containers) • Some devices just behave erratically. (random reboots, cannot connect to adb, wonky text output, battery issues)
  • 16. Thank You! • email: justin.ison@gmail.com • twitter: @isonic1 • https://github.com/isonic1/selenium-conf-2015