Speed up Espresso tests using single runner invocation
Learn how to speed up your Espresso mobile automation tests on BrowserStack App Automate using singleRunnerInvocation. Run tests on real device cloud.
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 increases 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 this, set the singleRunnerInvocation parameter in the builds REST API request to start your test execution.
With single runner invocation enabled for Espresso, video recordings and debugging logs are automatically split by individual test cases.
Automatically rerunning failed tests is not supported when singleRunnerInvocation is set to true. The retryTestsOnFailure and testIterations parameters have no effect because all test cases run together in a single instrumentation process, which prevents BrowserStack from isolating and rerunning an individual failed test. To automatically rerun failed tests, set singleRunnerInvocation to false, which is the default. For more information, see Automatically rerun failed Espresso tests.
| Parameter | Description | Values |
|---|---|---|
singleRunnerInvocation |
Execute test cases together with a single test runner invocation. | true / false. Default: : false |
Example cURL request to start your Espresso tests:
Related topics
-
Manage your uploaded app or test suite using our upload app REST API and upload test suite REST API.
-
Use the get app API endpoint and list test suites API endpoint to list your recently uploaded apps and test suites.
-
Delete your uploaded app or test suite using the delete app API endpoint and delete test suite API endpoint.
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!