Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy
No Result Found

Single runner invocation

By default, each Espresso test case is invoked separately using the test runner. There is reduced shared state between different test cases as each test runs in its own instrumentation instance. With this default workflow, there is overall greater stability for your tests in general.

However, this will increase overall execution time for your build as each test case spawns a new instrumentation process. Alternatively, you can disable this behavior and execute all test cases together with a single test runner invocation (on each device). This can help significantly speed up the test execution time. To do so, you can use the singleRunnerInvocation parameter in the REST API request to start your test execution.

REST API endpoint:

POST /app-automate/espresso/v2/build
Parameter Description Values
singleRunnerInvocation Execute test cases together with a single test runner invocation. true / false.
Default: : false

Example cURL request to start the execution of your Espresso tests:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" \
-d '{"singleRunnerInvocation": "true", "devices": ["Samsung Galaxy S8-7.0"], "app": "bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", "testSuite": "bs://e994db8333e32a5863938666c3c3491e778352ff"}' \
-H "Content-Type: application/json"
Note: With single runner invocation, all your test cases will have combined video recording and debugging logs on each device. If you want to have separate video recording and debugging logs for each test case, disable single runner invocation.

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