Skip to main content
Table of Contents

Sessions

Each executed build is composed of one or more test sessions. By default, each session is the execution of your test-suite on a single device. Thus, each device in the build will have a single test session. However, if sharding is used, each session is the execution of a single shard on a single device. Thus, each device in the build will have multiple sessions (one for each shard).

Each session has a unique identifier (session ID) associated with it. This can be obtained using our Get build status endpoint. Using this session ID, you can use our REST API to access its test execution details including test results and debugging information for each individual test case.

Get session details

GET /app-automate/flutter-integration-tests/v2/android/builds/{buildID}/sessions/{sessionID}

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:

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/builds/81af471efee397ce3e60263ef6f54fc6deb57368/sessions/09a018967ec8b2dc5dd391de1130f69463840039"
  • buildID* String

    Build ID of the test session.

  • sessionID* String

    Session ID.

Response attributes 200 application/json

Response

{
  "id": "09a018967ec8b2dc5dd391de1130f69463840039",
  "status": "failed",
  "start_time": "2023-08-23 05:40:25 +0000",
  "duration": 1377,
  "testcases": {
    "count": 2,
    "status": {
      "passed": 1,
      "failed": 1,
      "skipped": 0,
      "timedout": 0,
      "error": 0,
      "running": 0,
      "queued": 0
    },
    "data": [
      {
        "class": "MainActivityTest",
        "testcases": [
          {
            "name": "TEST-3241 - Live Page Focus View Performance",
            "start_time": null,
            "status": "failed",
            "duration": null,
            "video": "https://api.browserstack.com/app-automate/flutter-integration-tests/builds/81af471efee397ce3e60263ef6f54fc6deb57368/sessions/tests/09a018967ec8b2dc5dd391de1130f69463840039d6de33f9/video#t=0,1362",
            "id": "09a018967ec8b2dc5dd391de1130f69463840039d6de33f9",
            "instrumentation_log": "https://api.browserstack.com/app-automate/flutter-integration-tests/builds/81af471efee397ce3e60263ef6f54fc6deb57368/sessions/tests/09a018967ec8b2dc5dd391de1130f69463840039d6de33f9/instrumentationlogs"
          },
          {
            "name": "TEST-3240 - Live View Page Performance",
            "start_time": null,
            "status": "passed",
            "duration": null,
            "video": "https://api.browserstack.com/app-automate/flutter-integration-tests/builds/81af471efee397ce3e60263ef6f54fc6deb57368/sessions/tests/09a018967ec8b2dc5dd391de1130f694638400393f4842f3/video#t=0,1362",
            "id": "09a018967ec8b2dc5dd391de1130f694638400393f4842f3",
            "instrumentation_log": "https://api.browserstack.com/app-automate/flutter-integration-tests/builds/81af471efee397ce3e60263ef6f54fc6deb57368/sessions/tests/09a018967ec8b2dc5dd391de1130f694638400393f4842f3/instrumentationlogs"
          }
        ]
      }
    ]
  }
}
  • id String

    Sesssion ID.
    Example: 09a018967ec8b2dc5dd391de1130f69463840039

  • 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

    Details about each test-case execution for this session.

    SHOW VALUES
    • count Integer

      The total number of test cases in the session

    • status Object

      Count of the test cases for each status types.

      SHOW VALUES
      • 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

      Details about the test case execution.

      SHOW VALUES
      • class String

        Name of the class containing the test cases.

      • testcases Array

        List of all the test cases belonging to given class and their test execution details.

        SHOW VALUES
        • 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
          passed Explicit assertion in the test case that marks the test as passed.
          failed Explicit 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.
          skipped A 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.
          timedout Execution 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 was idle for 15 mins (Idle is defined as no update from the test runner)
          error An errored test is one that failed due to an unanticipated issue on BrowserStack testing infrastructure.
          running Test case that is being executed by the test runner.
          queued Test 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 deviceLogs parameter to true when running the test case.

        • network_log String

          URL to fetch network logs for the test case execution if you’ve set the networkLogs parameter to true when running the test case.

Get JUNIT report

GET /app-automate/flutter-integration-tests/v2/android/builds/{buildID}/sessions/{sessionID}/report

Fetch JUnit XML report for a given test session.

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/builds/1a2d3d0c5ef8532dd8dc1d789e228d57e868b6df/sessions/5009e99c5a96834ded164aa5b83f07960ae3f9ee/report"
  • buildID* String

    Build ID of the build to which the session belongs.

  • sessionID* String

    Session ID.

Response 200 text/xml

Response

<?xml version="1.0"?>
<testsuites>
    <testsuite name="com.sample.browserstack.samplecalculator.EnsureInputTests" tests="2" failures="2" skipped="0" timedout="0" errors="0" time="4.419" timestamp="2020-06-04 07:44:14 +0000">
        <properties>
            <property session_id="c9215a31aace1d2b885f1c7a9f5d73bce55b4543"/>
            <property devicename="Google Pixel 3"/>
            <property os="Android"/>
            <property version="9"/>
        </properties>
        <testcase name="ensureMultipleInputIsHandled" classname="com.sample.browserstack.samplecalculator.EnsureInputTests" result="failed" test_id="be2460f7f5fd21f73673060d4046199e6a94d9e624e815c7" time="0.422" video_url="https://www.browserstack.com/s3-upload/bs-video-logs-aps/s3-ap-south-1/be2460f7f5fd21f73673060d4046199e6a94d9e6/video-be2460f7f5fd21f73673060d4046199e6a94d9e6.mp4#t=0,3">
            <failure>java.lang.RuntimeException: Unable to capture screenshot.
          ... 32 more
            </failure>
        </testcase>
    </testsuite>
    <testsuite name="com.sample.browserstack.samplecalculator.EnsureOperationTests" tests="4" failures="4" skipped="0" timedout="0" errors="0" time="22.643" timestamp="2020-06-04 07:44:22 +0000">
        <properties>
            <property session_id="c9215a31aace1d2b885f1c7a9f5d73bce55b4543"/>
            <property devicename="Google Pixel 3"/>
            <property os="Android"/>
            <property version="9"/>
        </properties>
        <testcase name="ensureMultiplicationWorks" classname="com.sample.browserstack.samplecalculator.EnsureOperationTests" result="failed" test_id="be2460f7f5fd21f73673060d4046199e6a94d9e6406d4de4" time="2.366" video_url="https://www.browserstack.com/s3-upload/bs-video-logs-aps/s3-ap-south-1/be2460f7f5fd21f73673060d4046199e6a94d9e6/video-be2460f7f5fd21f73673060d4046199e6a94d9e6.mp4#t=8,13">
            <failure>java.lang.RuntimeException: Unable to capture screenshot.
          ... 32 more
            </failure>
        </testcase>
    <testsuite name="com.sample.browserstack.samplecalculator.ExampleInstrumentedTest" tests="1" failures="0" skipped="0" timedout="0" errors="0" time="0.009" timestamp="2020-06-04 07:45:01 +0000">
        <properties>
            <property session_id="c9215a31aace1d2b885f1c7a9f5d73bce55b4543"/>
            <property devicename="Google Pixel 3"/>
            <property os="Android"/>
            <property version="9"/>
        </properties>
        <testcase name="useAppContext" classname="com.sample.browserstack.samplecalculator.ExampleInstrumentedTest" result="passed" test_id="be2460f7f5fd21f73673060d4046199e6a94d9e65e747bcf" time="0.009" video_url="https://www.browserstack.com/s3-upload/bs-video-logs-aps/s3-ap-south-1/be2460f7f5fd21f73673060d4046199e6a94d9e6/video-be2460f7f5fd21f73673060d4046199e6a94d9e6.mp4#t=47,50"/>
    </testsuite>
</testsuites>

The response will be XML report comprising the details of each test-case execution in the session.

Get app profiling data

GET flutter-integration-tests/v2/android/builds/build_id/sessions/session_id/appprofiling

Access the app profiling logs to view the resource consumption(CPU, memory, battery, and network) by your app on the device. The logs are only available for Android.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/builds{buildID}/sessions/tests/{testID}/appprofiling"
  • buildID* String

    The build ID of the build to which the session belongs to.

  • TestID* String

    The testID of a test case execution. Each test case has a unique identifier (testID) associated with it. You can obtain this using our Get session details endpoint.

Response Attributes 200 OK application/json

Response

[
    {
        "ts": 1600264609,
        "cpu": 35,
        "mem": 5633,
        "mema": 3063,
        "batt": 100,
        "temp": 22
    },
    {...}
]         
  • ts Integer

    Epoch time.

  • cpu Integer

    Percentage of CPU utilisation of overall device.

  • mem Integer

    RAM utilisation of overall device in MB.

  • mema Integer

    RAM available in device in MB.

  • batt Integer

    Battery percentage.

  • temp Integer

    Temperature of device in Celsius.

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.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback