Skip to main content
No Result Found

CI/CD integration using REST API

Trigger test suite details and get build status using CI CD REST API

You can now integrate with your existing CI tools with low code automation to achieve the following objectives:

  • Automatically trigger low code tests upon deployment to the staging environment
  • Trigger critical tests on each commit to a pull request, or based on specific conditions
  • Incorporate low code tests into your existing sanity/regression pipeline jobs

API’s to trigger Test suite and get build status

Use REST API to trigger test suite’s and to get the build status.

Prerequisites

  • BrowserStack Username and Access key. You can find this in your account profile section. If you do not have an account yet, sign up for a Free Trial.
  • Test suite ID. You can find this on your test suite details page.

Get test suite ID

REST API details

Use the curl commands to trigger test suites and get build statuses. In the curl requests, replace the YOUR_USERNAME and YOUR_ACCESS_KEY variables with your account’s username and access-key.

Trigger test suite
Use the following curl command to trigger Low Code Automation test suites based on the TEST_SUITE_ID specified:

Copy icon Copy

Replace TEST_SUITE_ID with the id of the test suite you want to trigger.
The response returns a JSON object, which contains the build_id that you can use to fetch the test suite execution status.

Fetch build status

Use the following curl command to fetch the status of build execution for the BUILD_ID specified:

Copy icon Copy

Replace BUILD_ID with the build_id value you receive from the Trigger test suite API.

Integration with CI/CD pipelines

You can integrate with any of your existing CI/CD pipelines. Following are a some of the examples of popular CI tools which can be integrated using the REST APIs mentioned above

Jenkins

To integrate the provided Groovy script into your existing Jenkins pipeline, insert it within a stage. Make sure to replace placeholders with actual BrowserStack credentials.

Make sure the jenkins pipeline-utility-steps plugin is installed.

Use the following code snippet which contains the REST API request to integrate Jenkins pipeline with low code automation:

Groovy
Copy icon Copy

Azure pipelines

Add the provided script into your Azure Pipelines YAML file within a step, make sure to replace placeholders with actual BrowserStack credentials.

Yaml
Copy icon Copy

Bitbucket pipelines

Insert the provided script into your Bitbucket Pipelines YAML file within a step, ensuring to replace placeholders with actual BrowserStack credentials.

Yaml
Copy icon Copy

Circle CI

Integrate the provided script into your Circle CI configuration file within a job, make sure to replace placeholders with actual BrowserStack credentials.

Yaml
Copy icon Copy

Travis CI

Add the provided script into your Travis CI configuration file within a job, ensure to replace placeholders with actual BrowserStack credentials.

Yaml
Copy icon Copy

GitLab

Insert the provided script into your GitLab CI/CD YAML file within a job, ensure to replace placeholders with actual BrowserStack credentials.

Yaml
Copy icon Copy

Github actions

Integrate the provided script into your GitHub Actions workflow file within a step, ensure to replace placeholders with actual BrowserStack credentials.

Yaml
Copy icon Copy
Note: You can also integrate with any other CI/CD tools using the above mentioned REST API’s.

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle