18
© Sauce Labs, Inc. Parallel testing with Appium! Moiz Virani, Software engineer @ Sauce Labs, Inc .

Parallel testing with appium

  • Upload
    moizjv

  • View
    616

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Parallel testing with appium

© Sauce Labs, Inc.

Parallel testing with Appium!

Moiz Virani, Software engineer @ Sauce Labs, Inc

.

Page 2: Parallel testing with appium

© Sauce Labs, Inc.

CS @ University of kansas

Software engineer @ Sauce Labs

Core contributor @ Appium

About me

@moizjv [email protected]

Page 3: Parallel testing with appium

© Sauce Labs, Inc.

Overview

• Introduction• Appium architecture overview• Selenium Grid• Appium setup with grid• Demo• Scaling parallel tests• Demo 2• Conclusion

Page 4: Parallel testing with appium

© Sauce Labs, Inc.

AppiumI promise to be awesome!

Page 5: Parallel testing with appium

© Sauce Labs, Inc.

Appium

• Open source• Selenium for mobile• Client/Server architecture• JSON wire protocol • One device at a time with one server (present)• Yes selenium grid for parallel testing• Six language clients

Page 6: Parallel testing with appium

© Sauce Labs, Inc.

Appium: How it works

Test Script

Appium Server

Device Manipulat

ion (adb, etc)

Device Automation

(UI Automator)

Android Device

HTTP

Page 7: Parallel testing with appium

© Sauce Labs, Inc.

Parallel Tests It is so fast!

Page 8: Parallel testing with appium

© Sauce Labs, Inc.

Design principles :

• Atomic: small and concise• Independent• Organized• Configurable• https://github.com/saucelabs-test-frameworks/

Page 9: Parallel testing with appium

© Sauce Labs, Inc.

Selenium Grid :

• Another web server - Hub• Manages other webdrivers• Manages appium servers • Responsible for distributing

tests• Appium server is here - Node

Page 10: Parallel testing with appium

© Sauce Labs, Inc.

Steps for grid setup:

• Download Selenium-standalone.jar

j java -jar selenium-server-standalone-2.48.2.jar -role hubava -jar selenium-server-standalone-2.48.2.jar -role hub

• Start it with role as hub• Start multiple emulators or devices (iOS limitation)

Page 11: Parallel testing with appium

© Sauce Labs, Inc.

Steps for grid setup: Appium

• Currently appium can only handle one session at a time• Start multiple appium sessions with different port • Define configuration file to rester session with hub• Register session with hub using —nodeconfig.json• https://github.com/appium/appium/blob/master/docs/en/adva

nced-concepts/grid.md• example

https://github.com/moizjv/appium/blob/appium_meetup/android1.json

node . --port 4000 --nodeconfig ./android1.json -U emulator-5554 -bp 2252

node . --port 4000 --nodeconfig ./android1.json -U emulator-5554 -bp 2252

Page 12: Parallel testing with appium

© Sauce Labs, Inc.

Running parallel tests

• Configure tests to run in parallel• Point test to hub as remote driver• Set capabilities to match registered remote

driver• Run the tests!!!

Page 13: Parallel testing with appium

© Sauce Labs, Inc.

Demo Live demos are dangerous!

Page 14: Parallel testing with appium

© Sauce Labs, Inc.

Conclusion

• Parallel tests should be written to scale• Presently iOS has limitation one simulator at a time• Parallel testing strategy if done right can speed up

testing process significantly

Page 15: Parallel testing with appium

© Sauce Labs, Inc.

Quiz

• What is the latest version of beta • What is the latest version of appium• What does appium use under the hood for Android ?• What does appium use under the hood for iOS?

Page 16: Parallel testing with appium

© Sauce Labs, Inc.

Questions?

Test more, test oftenand succeed!

Happy Testing :)

Page 17: Parallel testing with appium

© Sauce Labs, Inc.

Thank You.

Page 18: Parallel testing with appium

© Sauce Labs, Inc.

Q and A!