Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy
No Result Found
Connect and get help from 7,000+ developers on our Discord community. Ask the CommunityAsk the Community

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:

Terminal
Copy icon Copy

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