Skip to main content
Table of Contents
Documentation home icon APP AUTOMATE API

Builds

Each build represents an execution of your Flutter Android test-suite on one or more devices on Browserstack. Use our REST API to execute and manage your test builds. In addition, you can fetch build status in real-time as well as obtain access to video recording and other test execution logs.

Get build status

GET /app-automate/flutter-integration-tests/v2/android/builds

Once a build is started, you can fetch its status using this endpoint. You can obtain the overall summary of your test execution as well as results for each individual test case.

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* String

    Unique build ID for your Flutter test execution.
    Example: 57dd68e05f76ca3c9c0d4600fd78ae064fa537bb

Response attributes 200 application/json

Response

{
    "id": "5c5ab4338cec13aeb78f7a6977344556ac00bccd6",
    "framework": "Flutter",
    "duration": 83,
    "status": "failed",
    "input_capabilities": {
        "devices": [
            "Samsung Galaxy S20-10.0",
            "OnePlus 7-9.0",
            "Google Pixel 3-9.0"
        ],
        "project": "Flutter_Test",
        "app": "bs://9c6dcb5649a8280ca800075bfd8f151115bba6b3",
        "testSuite": "bs://89c874f21852ba57957a3fdc33f47514288c4ba1"
    },
    "start_time": "2020-06-04 07:43:49 UTC",
    "app_details": {
        "url": "bs://9c6dcb5649a8280ca800075bfd8f151115bba6b3",
        "bundle_id": "com.sample.browserstack.samplecalculator",
        "version": "1.0",
        "name": "app-flutter.apk"
    },
    "test_suite_details": {
        "url": "bs://89c874f21852ba57957a3fdc33f47514288c4ba1",
        "bundle_id": "com.sample.browserstack.samplecalculator.test",
        "version": "",
        "name": "app-FlutterTest.apk"
    },
    "devices": [
        {
            "device": "Samsung Galaxy S20",
            "os": "android",
            "os_version": "10.0",
            "sharding": false,
            "sessions": [
            {
                "id": "4fc55a08d7e33651d962ad676c7d6a0a08902702",
                "status": "failed",
                "start_time": "2020-06-04 07:44:07 +0000",
                "duration": 62,
                "testcases": {
                    "count": 9,
                    "status": {
                        "passed": 3,
                        "failed": 6,
                        "skipped": 0,
                        "timedout": 0,
                        "error": 0,
                        "running": 0,
                        "queued": 0
                    }
                }
            }]
        },
        {
            "device": "OnePlus 7",
            "os": "android",
            "os_version": "9.0",
            "sharding": false,
            "sessions": [
            {
                "id": "1f5c3cb7d1f7560635f6c83eafe418a2fabbef0d",
                "status": "failed",
                "start_time": "2020-06-04 07:44:10 +0000",
                "duration": 59,
                "testcases": {
                    "count": 9,
                    "status": {
                        "passed": 3,
                        "failed": 6,
                        "skipped": 0,
                        "timedout": 0,
                        "error": 0,
                        "running": 0,
                        "queued": 0
                    }
                }
            }]
        },
        {
            "device": "Google Pixel 3",
            "os": "android",
            "os_version": "9.0",
            "sharding": false,
            "sessions": [
            {
                "id": "a8760f7f5fd21f73673060d4047899e6a94d9e6",
                "status": "failed",
                "start_time": "2020-06-04 07:44:08 +0000",
                "duration": 62,
                "testcases": {
                    "count": 9,
                    "status": {
                        "passed": 3,
                        "failed": 6,
                        "skipped": 0,
                        "timedout": 0,
                        "error": 0,
                        "running": 0,
                        "queued": 0
                    }
                }
            }]
        }
    ]
}
  • id String

    Unique build ID for your test execution.
    Example: 4fc55a08d7e33651d962ad676c7d6a0a08902702

  • framework String

    Name of the automation framework. This is set to Flutter.

  • duration Integer

    Total duration for build completion (in seconds). This includes the time taken to install the app and test-suite, and setting up the device along with the test execution time of all the test cases.

  • status Integer

    Status of the your build execution. This is computed based on the status of every test case executed in your entire test-suite. Learn more about status API

  • input_capabilities Object

    Details about the input parameters passed while starting the build execution.

    SHOW VALUES
    • devices Array

      List of devices on which the build was executed.
      Example: ["Samsung Galaxy S20-10.0", "OnePlus 7-9.0"]

    • project String

      Name of your project which was set inside the project parameter inside the build execution API.

    • app String

      The app_url of the app uploaded on BrowserStack.
      Example: bs://9c6dcb5649a8280ca800075bfd8f151115bba6b3

    • testSuite String

      The test-url of the test-suite uploaded on BrowserStack.
      Example: bs://89c874f21852ba57957a3fdc33f47514288c4ba1

  • start_time String

    Timestamp at which the build execution was started

  • app_details Object

    Details about the application under test uploaded on BrowserStack

    SHOW VALUES
    • url String

      The app_url of the app(.apk) file uploaded on BrowserStack.

    • bundle_id String

      Bundle ID or the package name of the app.

    • version String

      Version code of the app that was defined in the Android manifest file.

    • name String

      Name of your app(.apk) file.

  • test_suite_details Object

    Details about the test-suite uploaded on BrowserStack

    SHOW VALUES
    • url String

      The test_url of the test-suite(.apk) file uploaded on BrowserStack.

    • bundle_id String

      Bundle ID or the package name of the test-suite.

    • version String

      Version code of the test-suite. The value is null.

    • name String

      Name of your test-suite(.apk) file.

  • devices Array

    Test execution details for each device in the build.

    SHOW VALUES
    • device String

      The name of the device.

    • os String

      By default, this is set to Android.

    • os_version String

      OS version.

    • sharding Boolean

      Indicates if the sharding was enabled for this build.

    • sessions Array

      If sharding is disabled, each session is the execution of your test on a single device. Thus, each device will have a single session. If sharding is enabled, each session is the execution of a single shard on a single device. Thus, each device will have multiple sessions (one for each shard).

      SHOW VALUES
      • id String

        A unique session ID.
        Example: sdfnk324skdjf234jkldfs234sdfl1231sd

      • status String

        Status of this session.

      • start_time String

        Timestamp at which the session execution started.

      • duration String

        Duration of the session execution.

      • testcases Object

        Test case execution summary for this session.

        SHOW VALUES
        • count Integer

          The total number of test-cases in this session.

        • status Object

          Count of test-cases by each status type.

          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.

List recent builds

GET /app-automate/flutter-integration-tests/v2/android/builds

Fetch 20 recent test builds sorted by timestamp. You can also filter builds by their project name.

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"
  • project String

    The project name of the build(s).
    Example: Flutter_Test

Response attributes 200 application/json

Response

[
    {
        "id": "5c5ab4338cec13aeb78f7a6977344556ac00bccd6",
        "start_time": "2019-11-06 13:07:45 UTC"
    },
    {
        "id": "235ab7338cec13ae6b8f7a6977344556ac00bccd6",
        "start_time": "2020-06-04 07:43:49 UTC"
    }
]
  • Array

    List of recent test builds sorted by timestamp

    SHOW VALUES
    • id String

      Build ID.

    • start_time String

      Timestamp at which the build execution was started.

Execute a build

POST /app-automate/flutter-integration-tests/v2/android/builds

Start the execution of a new build on BrowserStack. While making a request, you must specify the application under test, Flutter Android app as well as a list of devices to execute your tests on. In addition, you can specify a number of other parameters to customise test execution. Every build has a unique build_id associated with it. This is returned in the response to this endpoint.

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/builds" \
-d '{ "testPackage": "<test-package-id>",  "devices": ["Samsung Galaxy S8-7.0"]}' \
-H "Content-Type: application/json"
  • app* String

    Specify the application under test. Use app_url or custom_id or shareable_id of a previously uploaded app.

  • testSuite* String

    Specify a Flutter test suite. Use test_url or custom_id or shareable_id of a previously uploaded test-suite.

  • devices* Array

    List of devices to execute your tests on.
    Example: ['Samsung Galaxy S8-7.0', 'Google Pixel 3-10.0']

Response attributes 200 application/json

Response

{
    "message": "Success",
    "build_id": "5c5ab4338cec13aeb78f7a6977344556ac00bccd6"
}
  • message String

    Status of the request.

  • build_id String

    A unique identifier for your test execution.
    Example: 5c5ab4338cec13aeb78f7a6977344556ac00bccd6

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