Sessions
Each build consists of one or more test sessions. By default, a session represents your test suite running on a single device, so each device in the build has one session. If sharding is enabled, a session represents a single shard running on a single device, resulting in multiple sessions per device (one per shard).
Each session has a unique session ID, which you can retrieve using the Get Build Status endpoint. With this ID, you can use the BrowserStack REST API to access test execution details, including results and debugging information for each test case.
Get session details
You can fetch status and test execution details for a given test session. For individual test cases, you can also access test results and debugging information such as:
- Instrumentation logs
- Device logs
- Network logs
Request parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://api-cloud.browserstack.com/app-automate/maestro/v2/builds/57dd68e05f76ca3c9c0d4600fd78ae064fa537bb/sessions/c9215a31aace1d2b885f1c7a9f5d73bce55b4543"
-
buildID* String
Build ID of the test session.
-
sessionID* String
Session ID.
Response attributes 200 application/json
Response
{
"id": "15c05db0d2b193cef004c3f645db25a17233bfaa",
"status": "failed",
"start_time": "2025-05-20 13:38:29 +0000",
"duration": 67,
"testcases": {
"count": 2,
"status": {
"passed": 1,
"failed": 1,
"skipped": 0,
"timedout": 0,
"error": 0,
"running": 0,
"queued": 0
},
"data": [
{
"class": "ios-sample",
"testcases": [
{
"name": "ios-sample",
"start_time": "2025-05-20 13:38:35 +0000",
"status": "failed",
"duration": 28.404,
"video": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaa59caecc5/video#t=0,28",
"id": "15c05db0d2b193cef004c3f645db25a17233bfaa59caecc5",
"device_log": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaa59caecc5/devicelogs",
"network_log": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaa59caecc5/networklogs",
"maestro_commands": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaa59caecc5/commandlogs",
"maestro_log": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaa59caecc5/maestrologs",
"screenshots": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaa59caecc5/screenshot"
}
]
},
{
"class": "ios-alert",
"testcases": [
{
"name": "ios-alert",
"start_time": "2025-05-20 13:38:35 +0000",
"status": "passed",
"duration": 11.896,
"video": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaac266a19f/video#t=31,43",
"id": "15c05db0d2b193cef004c3f645db25a17233bfaac266a19f",
"device_log": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaac266a19f/devicelogs",
"network_log": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaac266a19f/networklogs",
"maestro_commands": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaac266a19f/commandlogs",
"maestro_log": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaac266a19f/maestrologs",
"screenshots": "https://api.browserstack.com/app-automate/maestro/builds/5201c7ae5e5031ecfd0b01fde847c3adda658854/sessions/tests/15c05db0d2b193cef004c3f645db25a17233bfaac266a19f/screenshot"
}
]
}
]
}
}
-
id String
Session ID.
Example:5c5ab4338cec13aeb78f7a6977344556ac00bccd6 -
status String
Test session status. Know more about viewing test status.
-
start_time String
Timestamp for starting test session execution.
-
duration String
Total duration for test session execution.
-
testcases Object
â–¶ SHOW VALUESDetails about each test-case execution for this session.
-
count Integer
The total number of test cases in the session
-
status Object
â–¶ SHOW VALUESCount of the test cases for each status types.
-
passed Integer
Total count of test cases with explicit test assertions that marks the test as passed.
-
failed Integer
Total count of test cases with uncaught exceptions or explicit test assertions that marks test as failed.
-
skipped Integer
Total count of test cases that never got executed by the test runner.
-
timedout Integer
Total count of test cases that got timed-out.
-
error Integer
Total count of test cases that errored due to an unanticipated issue on BrowserStack.
-
running Integer
Total count of test cases that are currently under execution.
-
queued Integer
Total count of test cases that are queued for execution.
-
-
data Array
â–¶ SHOW VALUESDetails about the test case execution.
-
class String
Name of the class containing the test cases.
-
testcases Array
â–¶ SHOW VALUESList of all the test cases belonging to given class and their test execution details.
-
name String
Name of the test case
-
start_time String
Timestamp at which the test execution started.
-
status String
Status of the test case execution on a given device or session. Different values for test case status:
Key Value passedExplicit assertion in the test case that marks the test as passed. failedExplicit assertion in the test case that marks the test as failed. This can also happen if there is an uncaught runtime exception during test execution. skippedA test case that was never invoked during the test-suite execution. It can happen in two different scenarios :
(a) The session got timed out (by BrowserStack) because it exceeded 2 hour limit. All remaining test cases in the session will be marked as skipped.
(b) Execution of a test case is skipped by the test runner. For e.g. This can happen if the test case uses an @Ignore annotation.timedoutExecution of a test case (in a running state) is halted either because :
(a) The session got timed out (by BrowserStack) because it exceeded 2 hour limit
(b) The test case wasidlefor 15 mins (Idleis defined as no update from the test runner)errorAn errored test is one that failed due to an unanticipated issue on BrowserStack testing infrastructure. runningTest case that is being executed by the test runner. queuedTest case queued for execution. This is the default initial state. -
duration String
Total duration of test case execution on the given device.
-
video String
URL to fetch video logs for the test case execution.
-
id String
Unique ID of the test case execution on the given device.
-
instrumentation_log String
URL to fetch instrumentation logs for the test case execution.
-
device_log String
URL to fetch device logs for the test case execution if you’ve set the
deviceLogsparameter totruewhen running the test case. -
network_log String
URL to fetch network logs for the test case execution if you’ve set the
networkLogsparameter totruewhen running the test case.
-
-
-
Get app profiling data v2
Access the detailed app profiling metrics such as installed app size, UI rendering metrics, resource consumption metrics, etc. For details, refer to the App profiling testing on App Automate documentation.
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://api-cloud.browserstack.com/app-automate/builds/<build_id>/sessions/<session_id>/appprofiling/v2"
-
buildID* String
The build ID of the build to which the session belongs to.
-
sessionID* String
The session ID of the session.
Response Attributes 200 OK application/json
Response
{
"metadata": {
"device": "...",
"os_version": "...",
"created_at": "..."
},
"data": {
"units": {
"app_size": "MB",
"app_start_time": "ms",
"cpu": "%",
"mem": "MB",
"batt": "mAh",
"diskio": "kb",
"networkio": "kb",
"ui_rendering": "fps",
"screen_load": "ms"
},
"org.wikipedia.alpha": {
"status": "success",
"detected_issues": [],
"metrics": {
"app_size": 20.37,
"cpu": {
"avg": 5.06,
"max": 12.52,
"cpu_usage_data": "https://api-cloud.browserstack.com/app-automate/builds/<build_id>/sessions/<session_id>/appprofiling/v2/org.wikipedia.alpha/stats/cpu_usage"
},
"mem": {
"avg": 169.45,
"max": 243.57,
"mem_usage_data": "https://api-cloud.browserstack.com/app-automate/builds/<build_id>/sessions/<session_id>/appprofiling/v2/org.wikipedia.alpha/stats/mem_usage"
},
"batt": {
"total_batt_usage": 1.712,
"total_batt_usage_pct": 0.034,
"batt_usage_data": "https://api-cloud.browserstack.com/app-automate/builds/<build_id>/sessions/<session_id>/appprofiling/v2/org.wikipedia.alpha/stats/batt_usage"
},
"diskio": {
"total_reads": 260,
"total_writes": 15390,
"disk_usage_data": "https://api-cloud.browserstack.com/app-automate/builds/<build_id>/sessions/<session_id>/appprofiling/v2/org.wikipedia.alpha/stats/disk_usage"
},
"networkio": {
"total_upload": 41.8,
"total_download": 760.05,
"network_usage_data": "https://api-cloud.browserstack.com/app-automate/builds/<build_id>/sessions/<session_id>/appprofiling/v2/org.wikipedia.alpha/stats/network_usage"
},
"ui_rendering": {
"slow_frames_pct": 5.63,
"frozen_frames_pct": 0,
"num_anrs": 0,
"fps_data": "https://api-cloud.browserstack.com/app-automate/builds/<build_id>/sessions/<session_id>/appprofiling/v2/org.wikipedia.alpha/stats/fps"
},
"screen_load": {
"activity_load_time": [
{
"name": "org.wikipedia.alpha/org.wikipedia.main.MainActivity",
"load_time_data": [
{
"time_offset_ms": 4386,
"load_time": 295
}
]
}
]
}
}
}
}
}
-
metadata object
â–¶ SHOW VALUESInformation about the test environment.
-
device String
Name of the device used for testing.
-
os_version String
Operating system version of the device.
-
created_at String
Timestamp of when the session was created.
-
-
data object
â–¶ SHOW VALUESContains metric units and application profiling data.
-
units Object
â–¶ SHOW VALUESUnits of measurement for app profiling metrics.
-
app_size String
Unit of measurement for app size.
Example:MB. -
app_start_time String
Unit of measurement for app startup time.
Example:ms. -
cpu String
Unit of measurement for CPU usage.
Example:%. -
mem String
Unit of measurement for memory usage.
Example:MB. -
batt String
Unit of measurement for battery consumption.
Example:mAh. -
diskio String
Unit of measurement for disk input and output.
Example:KB. -
networkio String
Unit of measurement for network data.
Example:KB. -
ui_rendering String
Unit of measurement for UI rendering performance.
Example:fps. -
screen_load String
Unit of measurement for measuring screen load time.
Example:ms.
-
-
org.wikipedia.alpha Object
â–¶ SHOW VALUESPerformance metrics collected for
org.wikipedia.alpha.-
status String
Status of the profiling session.
Example:success. -
detected_issues Array
List of any issues detected during the run.
-
metrics Object
â–¶ SHOW VALUESPerformance metrics collected for the app.
-
app_size Number
Size of the app in megabytes.
-
cpu Object
â–¶ SHOW VALUESCPU usage statistics during the test.
-
avg Number
Average CPU usage during test in percentage.
-
max Number
Maximum CPU usage recorded in percentage.
-
cpu_usage_data String
URL to detailed CPU usage timeline data.
-
-
mem Object
â–¶ SHOW VALUESMemory usage statistics.
-
avg Number
Average memory usage in MB.
-
max Number
Maximum memory used during the test.
-
mem_usage_data String
URL to detailed memory usage data.
-
-
batt Object
â–¶ SHOW VALUESBattery usage statistics.
-
total_batt_usage Number
Total battery consumed in mAh.
-
total_batt_usage_pct Number
Battery usage as a percentage of total charge.
-
batt_usage_data String
URL to detailed battery usage timeline.
-
-
diskio Object
â–¶ SHOW VALUESDisk read/write activity.
-
total_reads Number
Amount of disk read operations in KB.
-
total_writes Number
Amount of disk write operations in KB.
-
disk_usage_data String
URL to detailed disk I/O stats.
-
-
networkio Object
â–¶ SHOW VALUESNetwork upload/download activity.
-
total_upload Number
Total network upload data in KB.
-
total_download Number
Total network download data in KB.
-
network_usage_data String
URL to detailed network usage stats.
-
-
ui_rendering Object
â–¶ SHOW VALUESUI rendering metrics.
-
slow_frames_pct Number
Percentage of frames rendered slowly.
-
frozen_frames_pct Number
Percentage of frames that were frozen.
-
num_anrs Number
Number of ANR (Application Not Responding) events.
-
fps_data String
URL to frame rate data over time.
-
-
screen_load Object
â–¶ SHOW VALUESScreen/activity load time metrics.
-
activity_load_time Array
â–¶ SHOW VALUESThe activity load time object.
-
name String
Fully qualified name of the activity loaded.
-
load_time_data Array
â–¶ SHOW VALUESList of time-based load events for the activity.
-
time_offset_ms Number
Time in milliseconds from test start when the event occurred.
-
load_time Number
Time in milliseconds taken to load the activity.
-
-
-
-
-
-
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.