Configuration
Using RobusTest Hub, you can run your own Appium tests on devices connected to the RobusTest device cloud. You need make changes at a few places in your test script to get going.
The main points to be taken care of are
- Which Appium server to run on - The Hub URL [Mandatory]
- What build to run on - App/Build details [Mandatory]
- Which device to run on - Device details [Mandatory]
- Allocating the device for test run - Reserving device [Optional]
- How to uniquely identify your test run - Identifier [Optional]
Following are the changes that need to be made
- Change the Appium URL to point to the RobusTest Hub. If you are running your tests on a local instance of Appium using devices connected to your system, the Appium URL will look like
Change this value to point to the RobusTest Hub.
After the change, your RobusTest Hub URL will look like
http://192.168.1.1:3142/wd/hub
Youc can find the Hub Server URL from your RobusTest admin.
- app - Set the app value to the build URL that is created for every build that is uploaded to RobusTest. In case you wish to execute your tests on a specific build, you just need to select that build from the Project Dashboard and copy the link to the build by clicking on the Selected Build URL button. The URL will look like
You can also use the standard URL for the latest build. The URL will look something like
http://192.168.1.1:8081/build/581b074e7ec1653a30d1f438/581ae4a37ec165084ea9cdc3/latest.apk
- device - Add the attribute deviceID to the desired capabilities. The value for deviceID should be the unique Device ID generated by RobusTest for the device. This is the attribute that will be used to decide the device on which the tests should run.
The list of connected devices and their IDs can be found out from the Health Page of our instance.
If you wish to select the device programatically, then you can use the devices API.
http://192.168.1.1:3142/v3/devices
The response of the above API looks like below
{"available": [{"available": "Yes", "supportHub": "Yes", "gmsversion": "5.0.2", "name": "SM-G530H", "supportManual": "Yes", "supportAutomation": "Yes", "adb_id": "404b6569", "reservedForProject": [], "os": "android"}], "busy": [], "totalOffline": 0, "offline": [], "total": 1, "totalBusy": 0, "totalAvailable": 1}
From the response, one can find out details like availability of device for RobusTest Hub, device name, Android version, etc., This response can be used to filter out devices that can be used to run Appium tests on the Hub.
- Reserving a device - To ensure that the device that you identify for your test run does not get allocated to another job/session, you should reserve your device. Do make sure that you unreserve the device at the end of the test session. Else the device will not be usable by any other user.
Reserve a device
URL:
http://[DEVICE LAB URL]/v3/device/<device ID>/reserve?accesskey=[access key]
HTTP Method: PUT
API Payload:
{ "project": "<project ID - mandatory>", "reserveKey" : "<reserve key for identifying the key - optional>" }
Unreserve a device
URL:
http://[DEVICE LAB URL]/v3/device/<device ID>/reserve?accesskey=[access key]
HTTP Method: DELETE
Details available at http://api.robustest.com/#tag/device
- RobusTest Identifer - When running jobs on the Appium Hub, there may be many Appium sessions created. In order to group all the test sessions created as part of a single job, use the robustestIdentifier desired capability and give it a value that will be unique for every job but same for all sessions within that job. This will ensure that details for all your test sessions which are part of one job are grouped together and available for analysis.
You can see your Appium Hub sessions on the following URL
http://[DEVICE LAB URL]/#/project/[PROJECT ID]/appium/hub
