belfast selenium meetup
TRANSCRIPT
![Page 1: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/1.jpg)
Mobile Grid SetupBelfast Selenium Meetup
October 15, 2015
![Page 2: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/2.jpg)
Mobile Cloud Test Services * personal favorites
• Sauce Labs *
• Test Object *
• Amazon Test Cloud (was Appthwack *)
• Google Test Lab (was Appurify)
• Perfecto Mobile *
• Testdroid
• Xamarin
• TouchTest
• Keynote (was Device Anywhere)
• And many more…
![Page 3: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/3.jpg)
The Cloud• The Pros:
• It’s the present and the future of automated testing.
• Ease of setup and integration.
• Save on costs of buying mobile devices.
• Some services provide you with good analytics and reporting.
• Some services integrate well with cloud CI services. (e.g. TravisCI)
• You expose your app to a much larger range of devices and OS’s.
• The Cons:
• It can be difficult to narrow down issues.
• Is it my network?
• Is it their network or somewhere in-between?
• Is there a problem with my test script?
• Is there a problem with my test framework?
• Is there a bug with my language bindings?
• Is my app at fault?
• The costs can be significant if running full-time CI.
• Tests could take an incredible amount of time to complete.
• Latency.
• This could also depend on the tier of service you have.
• Tests could occasionally hang or timeout without any helpful information as to why.
![Page 4: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/4.jpg)
The Mobile Grid• The Pros:
• It’s not that difficult once you know how.
• The awesome Appium developers baked a grid node into the Appium server.
• appium —nodeconfig android.json -p 4000 -bp 2250 —udid emulator-5554 (or device udid)
• In the long run you will save money.
• You have all you're critical test data local for debugging.
• You’re not handcuffed to a cloud test services 24/7 availability.
• Outages.
• Bugs in their software.
• Acquired by another company.
• You have a bit more flexibility capturing data to include in test reports.
• e.g. You have full access to every connected device.
• The Cons:
• It can be difficult to know where to begin.
• Tough finding documentation or examples.
• Takes a bit of time to setup and smoothing out.
• Require some degree of dev-ops knowledge.
• Random device issue. (I’ll cover this later.)
![Page 5: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/5.jpg)
What I’ll demo…• Getting connected devices programmatically.
• Launching Appium nodes programmatically.
• Running tests distributed.
• Running tests in parallel.
• Feeding test data into Allure.
• Generating the Allure report.
• Lets briefly look at the code…
![Page 6: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/6.jpg)
Appium & Hub Server Methods
![Page 7: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/7.jpg)
Rake File
![Page 8: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/8.jpg)
Spec Helper
![Page 9: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/9.jpg)
Spec Example
![Page 10: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/10.jpg)
• 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
• 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
The Demo
![Page 11: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/11.jpg)
Wunderlist Mobile Grid
![Page 12: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/12.jpg)
![Page 13: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/13.jpg)
That is great & all but reporting is key!
![Page 14: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/14.jpg)
Challenges• Random adb disconnects.
• Solved this by programmatically rebooting USB hubs before every test run.
• Random WiFi disconnects.
• Possible Solutions:
• Reverse USB tethering.
• WiFi connection apps.
• Using multiple routers on different channels.
• Spreading the devices apart.
• Alternatives to real devices:
• Using emulators with VNC clients. Facebook does this.
• Using Genymotion emulators. It’s the closest software to a real device.
• Using Docker containers with android emulators as nodes to connect to a hub.
• Some devices behave erratically.
• Finding relavent documentation.
• Finding solid examples.
![Page 15: Belfast Selenium Meetup](https://reader031.vdocument.in/reader031/viewer/2022021918/58a17fd61a28abca5a8b4a6b/html5/thumbnails/15.jpg)
Thank You!
• email: [email protected]
• twitter: @isonic1
• https://github.com/isonic1/selenium-conf-2015