selenium israel meetup

16
Mobile Grid - Getting Starte d Selenium Israel Meetup November 25, 2015

Upload: justin-ison

Post on 13-Apr-2017

749 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Selenium Israel Meetup

Mobile Grid - Getting Started

Selenium Israel Meetup November 25, 2015

Page 2: Selenium Israel Meetup

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.

Page 3: Selenium Israel Meetup

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…

Page 4: Selenium Israel Meetup

Appium Server & Nodes Methods

Page 5: Selenium Israel Meetup

ADB Methods (Video and Logcat)

Page 6: Selenium Israel Meetup

Rake Task

Page 7: Selenium Israel Meetup

Spec Helper

Page 8: Selenium Israel Meetup

Spec Example

Page 9: Selenium Israel Meetup

• 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

Page 10: Selenium Israel Meetup

Wunderlist Mobile Grid

Page 11: Selenium Israel Meetup

• 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

Page 12: Selenium Israel Meetup
Page 13: Selenium Israel Meetup
Page 14: Selenium Israel Meetup

That is great & all but reporting is key!

Page 15: Selenium Israel Meetup

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)

Page 16: Selenium Israel Meetup

Thank You!

• email: [email protected]

• twitter: @isonic1

• https://github.com/isonic1/selenium-conf-2015