Appium parallel test execution
A lean, up-to-date, and cross-platform solution to run your mobile tests into a Selenium Grid using Appium.
- How you can use this repo
- Technical Decisions
- About the apps
- How to run the tests
How you can use this repo
You can use this repo as a start point to implement your own cross-platform parallel execution in a grid. It uses different libraries and design pater to make it lean, easy to maintain and extend.
This section will show to you the libraries, frameworks and design decisions that made a lean architecture possible.
Languages and Frameworks
This project using the following languages and frameworks:
- Java 11 as the programming language
- TestNG as the UnitTest framework to support the test creation
- Appium as the mobile test automation framework
- Seleium Grid as the grid and paralellism solution
- AsseertJ as the fluent assertion library
- Allure Report as the testing report strategy
- Log4J2 as the logging manage strategy
- Owner to minimize the code to handle the properties file
We know that any automation project starting with a good test architecture. This project can be your initial test architecture for a faster start. You will see the following items in this architecture:
- Page Objects pattern
- Configuration files
- Parallel execution
What you need
- Java JDK 11 installed and configured (with
- IDE (to import this project using Maven)
- Android SDK (for Android execution | with
- Android AVD created (or Genymotion)
- XCode and the iPhone Simulator (for iOS execution)
- Appium installed through npm
To execute the examples over the Android platform you'll need:
- Android SDK
- Updated Build Tools, Platform Tools and, at least, one System Image (Android Version)
- Configure Android Path on your environment variables
- ANDROID_HOME: root android sdk directory
- PATH: ANDROID_HOME + the following paths = platform-tools, tools, tools/bin
- And Android Virtual Device
- AVD or Genymotion
Inspect elements on Android
To execute the examples over the iOS platform you'll need:
- MacOS machine :-)
- Xcode installed
- iPhone simulator (I recommend, for these tests iOS version > 10)
- Follow all the steps on https://github.com/appium/appium-xcuitest-driver
Inspect elements on iOS
About the apps
The Fastip app can be downloaded by this repository https://github.com/ptraeg/mobile-apps-4-ways
I have built the apps for Android and iOS platform, and these are located in app folder.
How to run the tests
On a MacOs machine give write access to node_modules:
sudo chmod -R 777 /usr/local/lib/node_modules
Try to always have Appium and libraries updated.
- verify the core Appium version on npm appium site. To see your Appium version run
appium --versionon the Terminal/Command Prompt
- verify the Appium library version on https://github.com/appium/java-client
- if it differs from
pom.xmlfile, update it!
- if it differs from
First you'll need to start the hub and the nodes. Please read the Start commands to lear now to start it.
Each node is configured through a json file in json folder.
Remember you gonna need to change some values, like
The port information is also linked on
launch_grid.sh file, that pass this and other informations by parameter.
After change all this information for your execution, execute the suite.xml file. Each test have 3 parameters:
These parameters are linked to the test files using TestNG, so when you execute the suite.xml file all these parameters will be used on test file.
About the test
On the package
com.eliasnogueira you'll find the test script
TipTest.java that uses the information on
suite.xmlto execute the tests in Android or iOS
Please, read this post: https://medium.com/@eliasnogueira/got-capabilitynotpresentonthegridexception-66cbc1aa06b7
Any question, error or feedback?
Please fill an issue