NOTE: this is a fork from @eliasnogueira's repo, give him a high five or mention if you use this!
This repo holds a test framework that allows you to execute tests in parallel using Appium and TestNG. Currently only has support for android tests. In the future I'll try to add support for:
- iOS (running tests on the simulator)
- Selenium Webdriver
- Zalenium
- Dockerize everything to avoid installation issues
- API testing (probably with RestAssured)
- Java JDK (with JAVA_HOME and PATH configured)
- IDE (and import this project using Gradle)
- Android Studio (with ANDROID_HOME and PATH configured)
- Android AVD created
- XCode and an iPhone Simulator (for iOS execution)
- Appium installed through npm
- Gradle
The Fastip app can be found in the app folder. It was built from ptraeg's repo.
You can use the uiautomatorviewer to inspect elements on Android devices or you can use Appium Desktop.
To execute the examples over the iOS platform you'l need:
- MacOS machine
- Xcode installed
- iPhone simulator
- Follow all the steps on appium's docs
You also can use Appium Desktop or you can use the Macaca App Inspector
Try to always have Appium and libraries updated.
- Verify the core Appium version on npm appium site. To see your Appium version run
appium --version
on Terminal - Verify the Appium library version
- If it differs from 'build.gradle' file, update it.
First you'll need to start the hub and the nodes.
Each node is configured through a json file in json folder. Remember you gonna need to change some values, like browserName, version, platform, url, host, port, hubPort and hubHost
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:
- platform
- udid
- platformVersion
This parameters are linked to the test files using TestNG, so when you execute the suite.xml file all these parameter will be used on test file.
On the package com.eliasnogueira you'l find the test script TipTest.java
_ that uses the information on config.properties
and suite.xml
to execute the tests in Android or iOS
Please, read this post: https://medium.com/@eliasnogueira/got-capabilitynotpresentonthegridexception-66cbc1aa06b7
Please fill an issue ;-)
When working with appium in parallel you need to pay attention to a few simple but very important things.
If you take a look at the start-commands.txt file and the json files for appium, you need to set different ports for a few different things:
- wda
- systemPort
- boostrapPort
I lost many hours of trial and error until I finally got a working solution with 2 devices, despite the fact that I had 3 devices configured but only 2 were running the tests.
Another thing, I could never point my tests to the exact device I wanted, even though I put the exact udid and android version on the capabilities when running the tests locally ,for some reason the tests always run on different devices.