Managing Device Sessions
List device sessions
curl -u <api-key>: https://cloud.bitbar.com/api/me/projects/PROJECT_ID/runs/RUN_ID/device-sessions
Get a device session
curl -u <api-key>: https://cloud.bitbar.com/api/me/projects/PROJECT_ID/runs/RUN_ID/device-sessions/DEVICE_SESSION_ID
Retry a device session
Note
Retrying a device session leads to test interruption (if tests are run), current results are removed, and the tests are started again. The device session gets a new ID.
curl -X POST -u <api-key>: https://cloud.bitbar.com/api/me/projects/PROJECT_ID/runs/RUN_ID/device-sessions/DEVICE_SESSION_ID/retry
Get running device sessions
To get all device sessions that are in the running state, send the following request with the state_eq_running
filter parameter:
curl -u <api-key>: https://cloud.bitbar.com/api/v2/users/{userId}/device-sessions?filter=state_eq_running
Note
The filter applies to live testing only.
Get device session files
Note
A specific file can be downloaded by directUrl
or by the API.
curl -u <api-key>: https://cloud.bitbar.com/api/me/projects/PROJECT_ID/runs/RUN_ID/device-sessions/DEVICE_SESSION_ID/output-file-set/files
Get device session screenshots
Note
Screenshots are included in ../device-sessions/DEVICE_SESSION_ID/output-file-set/files
.
curl -u <api-key>: https://cloud.bitbar.com/api/me/projects/PROJECT_ID/runs/RUN_ID/device-sessions/DEVICE_SESSION_ID/screenshots
Download a device session screenshot
Note
They can be downloaded in the same way as other files, however, the screenshot ID is different from the file ID.
curl -u <api-key>: https://cloud.bitbar.com/api/me/projects/PROJECT_ID/runs/RUN_ID/device-sessions/DEVICE_SESSION_ID/screenshots/ID
Filter device session files
Use the name_notlike
filter parameter to exclude the specified file from the query result.
curl -u <api-key>: https://cloud.bitbar.com/api/me/device-sessions/{id}/output-file-set/files?filter=name_notlike_{file-name}