Who am I ?
Software Engineer @ SauceLabs - Emulators & Simulators Team
Fullstack developer, Nodejs enthusiast
More than 300 combinations of browsers/OS
Test mobile & webapps in parallel
Watch videos, screenshots, logs,... of your automated tests
What is Appium ?
Appium is an open source test automation framework for use with native, hybrid and mobile web apps.
It drives iOS, Android, Windows desktop apps and more using the WebDriver protocol
Why Appium ?
How appium works
npm install -g appium
Before testing, make sure you have emulators|simulators available
Let the tests begin!
git clone https://github.com/vrunoa/appium-workshop
The idea is to follow this slides and start creating tests from knowing nothing to run a test on the cloud using a tunnel.
For order of this to happen we are going to follow the exercises under this repo. Check the README inside every exercise folder. And if you have any doubts ask me or cheat by looking at the solution.
The WebDriver client
Capabilities are the way to tell Appium which kind of session we are interested in.
Most common capabilities
|platformName||Which mobile OS platform to use||Android, iOS|
|platformVersion||Mobile OS version||9.3, 4.4.3|
|deviceVersion||The kind of mobile device or emulator to use||iPhone Simulator, iPad Simulator,iPhone Retina 4-inch, Android Emulator...|
|automationName||Which automation engine to use||Appium(default), Selendroid, XCuiTest|
|browserName||Name of mobile web browser to automate. Should be an empty string if automating an app instead||'Safari' for iOS and 'Chrome', 'Chromium', or 'Browser' for Android|
|orientation||(Sim/Emu-only) start in a certain orientation||LANDSCAPE or PORTRAIT|
Starting a session
Opening an url
Getting the page title
Closing current session
What if I want to run the same test on an Android emulator ?
Change the capabilities
Playing with elements
What about native apps testing ?
Use native application capabilities
Android common capabilities
|appActivity||Activity name for the Android activity you want to launch from your package.||.MainActivity, .Settings, .SplashActivity|
|appPackage||Java package of the Android app you want to run||com.example.android.app|
|appWaitActivity||Activity name for the Android activity you want to wait for||.MainActivity|
|avd||Name of avd to launch||Nexus-5-API-19|
|avdArgs||Additional emulator arguments used when launching an avd||-netfast, -http-proxy, -camera-front|
|app||The absolute local path or remote http URL to an .ipa or .apk file, or a .zip containing one of these. Appium will attempt to install this app binary on the appropriate device first||/abs/path/to/my.apk orhttp://myapp.com/app.ipa|
iOS common capabilities
|bundleId||Bundle ID of the app under test. Useful for starting an app on a real device or for using other caps which require the bundle ID during test startup. To run a test on a real device using the bundle ID, you may omit the 'app' capability, but you must provide 'udid'.||io.appium.TestApp|
|udid||Unique device identifier of the connected physical device||1ae203187fc012g|
|locationServicesEnabled||(Sim-only) Force location services to be either on or off. Default is to keep current sim setting.||true or false|
|locationServicesAuthorized||(Sim-only) Set location services to be authorized or not authorized for app via plist, so that location services alert doesn't pop up. Default is to keep current sim setting. Note that if you use this setting you MUST also use the bundleIdcapability to send in your app's bundle ID.||true or false|
|autoAcceptAlerts||Accept all iOS alerts automatically if they pop up. This includes privacy access permission alerts||true or false|
|autoDismissAlerts||Dismiss all iOS alerts automatically if they pop up.||true or false|
Changing contexts to test Hybrid apps
Using cloud devices at SauceLabs
Sauce connect, use a tunnel in the cloud
The future of Appium
Appium, rather than bundling all the separate drivers by default, becomes a driver management interface (in addition to continuing to play the role of automation frontend server). Appium gets a set of CLI tools for users to pick and choose which drivers and versions of drivers they want to use via Appium.