Appium Job Payload
Overview
Use this page to create an Appium job on RobusTest Hub with the Job Payload API. It shows a sample payload, what each part means, and the desired capabilities you can set.
For attributes shared by all frameworks (priority, runMode, device queries, and so on), see the Job Payload Attribute List.
API Endpoint:
POST /v3/job/new?accesskey=<ACCESS_KEY>
Header: Content-Type: application/json
Sample Payload (Android app)
{
"identifier": "Appium Demo Job - 1",
"project": "<PROJECT_ID>",
"type": "appium_hub_app",
"runSetting": "<RUN_SETTING_ID>",
"build": {},
"devices": {
"onlyGroupDevice": false
},
"framework": {
"attributes": {},
"desiredCapabilities": {
"platformName": "android",
"appium:automationName": "UiAutomator2",
"appium:app": "http://<ROBUSTEST_HOST>/v3/download/build/<BUILD_ID>.apk?accessKey=<ACCESS_KEY>",
"appium:appPackage": "com.example.app",
"appium:appActivity": "com.example.app.ui.HomeActivity",
"robustest:accessKey": "<ACCESS_KEY>",
"robustest:projectID": "<PROJECT_ID>",
"robustest:build": "<BUILD_ID>",
"robustest:runSetting": "<RUN_SETTING_ID>",
"robustest:jobIdentifier": "Appium Demo Job - 1",
"robustest:platformName": "android",
"robustest:testcaseName": "Sample Test Case"
}
}
}
Replace every value in < > with your own:
| Placeholder | Where to find it |
|---|---|
<PROJECT_ID> |
Project Home page URL. |
<RUN_SETTING_ID> |
Project → Run Settings. |
<BUILD_ID> |
Project Home page, in the builds list. |
<ACCESS_KEY> |
Your RobusTest access key. Keep it private. |
<ROBUSTEST_HOST> |
Your RobusTest server address. |
Top-level attributes
| Attribute | Description | Example |
|---|---|---|
| identifier | Name of the job. Use a value that is unique for each run. Keep it the same as robustest:jobIdentifier. |
"Appium Demo Job - 1" |
| project | Project ID. | "<PROJECT_ID>" |
| type | appium_hub_app for native apps. appium_hub_browser for mobile browsers. The value is case-sensitive. |
"appium_hub_app" |
| runSetting | Run Setting ID. | "<RUN_SETTING_ID>" |
| build | Leave empty ({}). The app is passed through appium:app in the desired capabilities. |
{} |
| devices | Device selection. "onlyGroupDevice": false lets the job use any matching device. You can also add deviceQueries, devicesGroupIDs or ids. See Device Configuration. |
{"onlyGroupDevice": false} |
| framework.attributes | Custom key-value pairs for the run. Can be empty. | {} |
| framework.desiredCapabilities | Appium and RobusTest capabilities used for the session. See the tables below. |
Other shared attributes such as desc, priority, runMode, jobCategories, maxJobAttempts and jobScope also work. See Core Job Attributes.
Desired capabilities
Appium capabilities
| Capability | Description | Example |
|---|---|---|
| platformName | android or ios. |
"android" |
| appium:automationName | Appium driver. UiAutomator2 for Android. |
"UiAutomator2" |
| appium:app | Download URL of the app build on RobusTest. | "http://<ROBUSTEST_HOST>/v3/download/build/<BUILD_ID>.apk?accessKey=<ACCESS_KEY>" |
| appium:appPackage | Package name of the app. | "com.example.app" |
| appium:appActivity | Launch activity of the app. | "com.example.app.ui.HomeActivity" |
| appium:newCommandTimeout | Seconds the session waits for the next command. Default is 60. | 120 |
RobusTest capabilities
| Capability | Description | Example |
|---|---|---|
| robustest:accessKey | Your access key. Required. | "<ACCESS_KEY>" |
| robustest:projectID | Project ID. | "<PROJECT_ID>" |
| robustest:build | ID of the app build. | "<BUILD_ID>" |
| robustest:runSetting | Run Setting ID. | "<RUN_SETTING_ID>" |
| robustest:jobIdentifier | Groups all sessions under one job. Use the same value as identifier. |
"Appium Demo Job - 1" |
| robustest:platformName | android or ios. |
"android" |
| robustest:testcaseName | Name of the test case shown in the report. | "Sample Test Case" |
| robustest:testcaseDescription | Description of the test case. Optional. | "Checks the login screen" |
| robustest:deviceID | Run on one specific device. Optional. | "<DEVICE_ID>" |
| robustest:devicesGroupIDs | Pick devices from these device groups. Optional. | ["<DEVICE_GROUP_ID>"] |
| robustest:forwardDevicePort | Forwards a port from the device. Optional. | 1111 |
| robustest:plugins | Plugins to enable, for example altunity. Optional. |
"altunity" |
Python example (client side)
The same capabilities can be set in your Appium script:
import random, string
access_key = "<ACCESS_KEY>"
suffix = ''.join(random.choices(string.ascii_uppercase + string.digits, k=6))
desired_caps = {
"platformName": "android",
"appium:automationName": "uiautomator2",
"appium:app": "http://<ROBUSTEST_HOST>/v3/download/build/<BUILD_ID>.apk?accesskey=%s" % access_key,
"robustest:accessKey": access_key,
"robustest:projectID": "<PROJECT_ID>",
"robustest:build": "<BUILD_ID>",
"robustest:jobIdentifier": "Appium Demo Job - " + suffix,
"robustest:testcaseName": "Sample Test Case",
}
Connect the Appium client to http://<HUB_URL>/wd/hub. See Appium Hub.
Create the job with curl
curl -X POST "http://<ROBUSTEST_HOST>/v3/job/new?accesskey=<ACCESS_KEY>" \
-H "Content-Type: application/json" \
-d @appium_job_payload.json
Troubleshooting
| Problem | What to check |
|---|---|
type '...' is not a valid job type |
Use appium_hub_app or appium_hub_browser, in lowercase. |
Job is invalid: runSetting is empty |
Add runSetting. |
| Sessions are not grouped under the job | robustest:jobIdentifier must match the job identifier. |
| App does not install | Check that the appium:app URL opens and the access key in it is correct. |
