Execute tests
Test your application on real devices using Maestro on BrowserStack’s App Automate
Prerequisites
- BrowserStack Username and Access key, which you can find in your account profile. If you have not created an account yet, you can sign up for a Free Trial.
- Application to test
- Test suite
Refer to supported devices list for the list of supported Android and iOS devices. For more details on the supported APIs, refer to our REST API reference page.
iOS devices below version 15 are not supported.
Upload app
Upload your Android (.apk or .aab file) or iOS (.ipa) apps to BrowserStack servers using either the REST API or App Management UI (available only in the new dashboard).
To upload an app using filesystem/public URL via the REST API, use the following cURL
example:
Here’s a cURL
command that uses sample values to upload an app to BrowserStack:
When you run the sample cURL
command, the BrowserStack server returns the following response:
{
"app_name": "debug.apk",
"app_url": "bs://c8ddcb5649a8280ca800075bfd8f151115bba6b3",
"app_version": "1.2.0",
"app_id": "c8ddcb5649a8280ca800075bfd8f151115bba6b3",
"uploaded_at": "2020-05-05 14:52:54 UTC",
"custom_id": "SampleApp",
"shareable_id": "steve/SampleApp",
"expiry" : "2020-06-05 14:52:54 UTC"
}
Note the app_url
key in the response. Its value is the unique url that BrowserStack has created for the app. Use this value to denote the app you want to test in your API call.
The App Management UI is available only in the new dashboard and not in the legacy (old) dashboard.
To upload an app using the App Management UI, follow the steps below:
-
On the App Automate dashboard, go to Utilities > App Management.
-
On the App Management UI, click Upload App.
-
Select the app you want to upload from your filesystem. If you are uploading the app using a public URL, paste the URL of your app in the or upload from URL box.
-
After selecting the app, choose the App Automate framework you want to use for testing. You can optionally add flags and a custom ID.
-
Click Upload. The app is uploaded to the BrowserStack servers. You’ll receive an App ID, which you can use to run tests.
To view your uploaded apps, apply the My Apps filter.
Also note the expiry
date. It indicates that the app you uploaded gets deleted from the server after 30 days.
To manage your apps, refer to the documentation on managing apps using App Management UI.
Upload test suite
Ensure that your test suite is contained within a parent folder, even if it includes only a single flow file. When unzipped, your test suite should look something like this:
Upload your Maestro test suite (.yml) file to BrowserStack servers using the following REST API request:
Here is a sample response:
{
"test_suite_name": "Flows.zip",
"test_suite_url": "bs://89c874f21852ba57957a3fdc33f47514288c4ba1",
"test_suite_id": "89c874f21852ba57957a3fdc33f47514288c4ba1",
"uploaded_at": "2020-09-09 15:35:00 UTC",
"custom_id": "SampleTest",
"shareable_id": "Steve/SampleTest",
"framework": "maestro",
"expiry": "2020-10-09 15:35:00 UTC"
}
Folder structure for test suite:
To ensure your tests run successfully, organize your Maestro flow files in the correct folder structure before uploading. The test suite should be a .zip
file containing your flow files in the following structure:
Execute tests
You can execute tests on both Android and iOS devices.
Starting a build
To initiate test execution on BrowserStack, your API request must include:
-
Application under test
-
Maestro test-suite
Optional parameters can customize test execution. Each build receives a unique build_id
in the response. For more information on executing tests, refer to our REST API reference page.
To run the entire test suite, run the below request:
To run the a specific test suite, add the path to the specific test suite in the execute
parameter and run the cURL request:
Here is a sample response:
{
"message": "Success",
"build_id": "5c5ab4338cec13aeb78f7a6977344556ac00bccd6"
}
View test results
After initiating your Maestro test execution via the REST API:
-
Navigate to your App Automate dashboard and select your test.
-
You can access the following on the dashboard:
-
Live test results
-
Debugging logs (network, device, video etc.)
-
Comprehensive execution details
-
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
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!