Optimize execution time and performance on App Automate
Learn how to understand and reduce execution time for your App Automate tests by optimizing BrowserStack time and user time components.
Your total test execution time consists of two main components: BrowserStack time (infrastructure-related activities like queuing, device setup, and command processing) and user time (your test script execution, application responses, and network delays). Understanding these components helps you identify bottlenecks and optimize performance effectively.
This guide covers queuing, start time, session duration, and configuration impacts to help you run faster tests.
BrowserStack time and user time
When you run tests on App Automate, the total time you see (build or session duration) is split into two main components:
| Aspect | BrowserStack time | User time |
|---|---|---|
| Definition | The time your test spends inside BrowserStack’s infrastructure | Everything outside BrowserStack’s infrastructure |
| Components | • Preparing the device and Appium server before your script runs • Waiting in queue for an available device or parallels to free up • Executing your commands on the device • Wrapping up the session and finalizing logs and video |
• Network hops between your machine/CI and BrowserStack • Time your app and backend services take to respond • Extra waits, retries, sleeps and timeouts in your code • Any network constraints (VPN, firewall, SSL inspection, etc.) on your side |
| Depends on | BrowserStack infrastructure and the capabilities and configuration you choose | Your environment, application performance, and test code efficiency |
| How to reduce | • Smartly choosing devices/device pool that covers your need and is readily available • Reducing heavy logs/features you don’t need such as video logs, network logs etc. • Managing your parallels and queues effectively |
• Improving connectivity to BrowserStack • Optimizing your app/backend performance in test environments • Cleaning up unnecessary waits and command patterns in your test code |
Components of BrowserStack time
BrowserStack time is made up of the following components:
- Waiting time
- Start time
- Session duration (command execution)
- Miscellaneous time (stop time and small overheads)
Waiting time
Waiting time is the time your session waits in a queue before a suitable device is allocated and start time begins.
Common queue reasons include:
- No parallel available: You hit your parallel limit.
- Tier or device constraints: Asking for devices in high‑demand tiers or rare OS/device combinations.
- Async app not ready: Your app is still being signed or prepared.
- Region/device‑pool constraints.
Steps to reduce waiting time:
Follow these best practices to minimize waiting time:
Broaden device/OS selection where possible
Instead of a single strict device, use:
- Device groups or DDA (Dynamic Device Allocation). Refer to this doc for required config changes: Use regular expression to specify device attributes
- OS version ranges (e.g. >= 13.0), so that the request can match more devices and avoid bottlenecks.
Prefer Tier‑1/common devices for bulk runs
For large regression suites, choose Tier‑1/common devices with good availability. Refer to this page to understand which tier your device belongs to: BrowserStack - Devices tiers for Automate and App Automate
Reserve new and lower tier devices for targeted compatibility tests, not for every regression run.
Right‑size and organize parallels
If many sessions are blocked by “no parallel available”, you have two levers:
- Stagger test runs in your CI so you don’t start all suites at exactly the same time, or
- Upgrade your parallel capacity to match your real concurrency needs.
Use our App Automate plan API or App Automate dashboard to understand and organize how many sessions run in parallel.
Avoid unnecessary async app signing delays
If you consistently see async_app_not_ready queue reasons, consider:
- Using a simpler test build
- Contacting support with session IDs so we can optimize signing for you
Start time
Start time is the time from when BrowserStack receives your session creation request until the device and Appium server are ready to accept commands.
Internally, it includes:
- Device setup time
- Device allocation and readiness checks
- App download from storage
- App installation on the device
- Enabling requested device features (logs, video, network, etc.)
- Setting up local tunnels/VPN if enabled
- Appium server startup
- Initializing Appium and drivers so the first command can run
How start time can increase
Common drivers of higher start time:
- Large apps → longer download and installation
-
Many enabled capabilities and device features:
- Video recording, device logs, network logs
- Local Testing/VPN tunnels
- Extra device features (battery mocks, logging, etc.)
- Non‑default Appium configurations
Steps to reduce start time:
Minimize capabilities and features during start
Disable features you don’t actively use in a given run:
- Turn off video, device logs, and network logs for routine CI runs.
- Only enable them for debug builds or on‑failure retries.
- Avoid extra device features (battery mocks, heavy custom logging) unless you specifically test them.
Use default Appium where possible
Prefer BrowserStack’s default Appium instead of a non‑default/custom Appium configuration.
This avoids extra initialization overhead and keeps start time low.
Disable default‑on capabilities if not needed
In your capabilities, explicitly set default‑enabled features to off if you don’t use them:
E.g. browserstack.video = false, browserstack.deviceLogs = false, etc.
Optimize your app for cloud install
- Reduce app size (remove unused assets/debug symbols where possible).
- Re‑use previously uploaded apps instead of re‑uploading the same app frequently.
- Avoid test builds that log excessively on startup (it can slow initial boot and logging setup).
Use Local Testing only when required
- Set
browserstack.local = trueonly when your app or APIs are truly not reachable publicly. - When possible, test against public or staging endpoints instead of internal environments that require tunnels.
- If you must use Local Testing, run the tunnel on a stable, well‑connected host so setup is fast.
Session duration (command execution time on BrowserStack)
Once start time is over and the device is ready, session duration is the time when your commands are executing on BrowserStack until your test calls driver.quit/session stop.
How can your configuration increase session duration?
Session duration can grow due to:
- Many commands, repeated element lookups, long chains of small actions.
- Inefficient find element strategies (e.g. heavy XPath locators).
- Long, global implicit waits or many fixed sleep’s.
- Heavy capabilities: verbose logging, network logging, videos, etc.
- High network latency between your CI and BrowserStack region
- Slow app or backend responses
Steps to reduce session duration:
Simplify and optimize your test commands
Use Appium best practices for locators:
- Prefer ID/accessibility ID over heavy XPath.
- Avoid deep or brittle XPath chains that are expensive to evaluate.
Reduce duplicated commands:
- Remove unnecessary navigations or repeated checks.
- If you’re using watchers or custom hooks (especially on Android), make sure they are not running excessively
Fix waits, sleeps and timeouts
- Replace long sleeps with explicit waits that end as soon as a condition is met.
- Don’t rely on very high global implicit waits; they cause every failed lookup to block.
Handle timeouts correctly:
- Avoid repeatedly waiting for elements that never appear.
- Fail fast when conditions are unmet, rather than adding more retries.
Reduce logging overhead during CI
For bulk/regression runs:
- Turn off or reduce the use of: Network logs, Video recording, Device logs
- Enable them only on smaller “debug” suites or re‑runs of failed tests.
Improve network path
Avoid unnecessary VPN hops or proxies where possible, or ensure they are well‑provisioned
Optimize your app & backend for test paths
- Use a lightweight test build where crash reporting, analytics and other heavy background work are toned down for test environments.
- Optimize frequently used backend endpoints used in tests
Miscellaneous time (stop time and other overheads)
The miscellaneous time bucket includes the following:
Stop time is the time from when your script sends a session delete/quit until:
- BrowserStack finalizes logs, video and artifacts
- The device is cleaned up and returned to the pool
Steps to reduce miscellaneous/stop time:
Follow these best practices to reduce miscellaneous time:
Reduce test artifact volume
Keep video and expanded logs disabled for long or very chatty sessions when not needed.
Excessively verbose logging from the app itself will increase the size and processing time of logs at stop.
Stop sessions cleanly
Always end tests with a clean driver.quit/session delete rather than killing the test runner abruptly.
This avoids recovery/cleanup work that can add a bit of time.
Components of user time
User time may be shown as a single bucket, but you can think of it as:
- Script‑level waits, retries and sleeps
- Application/backend response time
- Network path between your environment and BrowserStack
Below are the components and what you can do to reduce each:
Script‑level waits, retries and sleeps
Time your test spends waiting by design, outside BrowserStack infrastructure:
- Hard sleeps:
sleep(10),Thread.sleep(5000), etc. - Retry loops and polling for conditions.
- Overly aggressive timeouts while looking for elements or states.
How you can reduce script‑level waits:
- Replace fixed sleeps with conditional, explicit waits that end as soon as the UI is ready.
- Apply realistic timeouts instead of very high global implicit waits.
Review flaky tests:
- Fix fragile locators and race conditions instead of stacking more sleeps.
- Ensure you are not masking real issues with extra waiting.
App and backend response times
Time taken by your own application and backend services:
- Loading screens, transitions, and in‑app flows
- API calls to your services (auth, payments, content, etc.)
- Third‑party APIs your app depends on
How you can reduce app and backend response times:
- Profile and optimize slow flows your tests hit most frequently such as home screen load, login screens, etc.
- Ensure test/staging environments use test configurations that avoid unnecessary heavy background tasks (e.g., non‑critical analytics).
Network path between your environment and BrowserStack
Network latency and overhead between your local machine or CI infrastructure and BrowserStack hub region in addition to any VPNs, proxies, SSL inspection layers your traffic passes through contributes to this bucket.
How you can reduce network path delays:
- Ensure your corporate network/VPN is not rate‑limiting or heavily inspecting traffic to BrowserStack.
Capabilities and their performance impact
Some App Automate capabilities significantly affect how long sessions take, especially start time and session duration. Below is a summary of high and medium impact capabilities and guidance on how to use them to keep tests fast.
| Capability/Feature | What it does | Main impact area | Impact level | How to reduce time |
|---|---|---|---|---|
Local Testing (browserstack.local = true) |
Creates a secure tunnel so devices can access apps/APIs hosted in your internal network. | Start time, Session duration, User time (network) | High | Use only when your app/backend are not publicly accessible. Avoid routing unrelated traffic through the same tunnel. |
Video recording (browserstack.video) |
Records a full video of the session. | Start time (video setup), Session duration, Stop time | High | Keep video enabled for debugging/small suites, but disable for long, high‑volume CI runs. A common pattern: run once without video; re‑run failed tests with video. |
| Network logs | Captures detailed network traffic (requests/responses) from the app. | Session duration, Stop time | High | Enable only when debugging network issues. Turn off for regular regression runs to reduce command overhead and artifact processing. |
| Device logs/Appium logs | Captures detailed logs from the device and Appium server. | Start time (log setup), Session duration, Stop time | High | Explicitly disable if you don’t need them for most runs. Turn them on only when you’re investigating a failure pattern. |
| Non‑default Appium configuration | Uses a non‑default Appium setup or custom server flags. | Start time, Session duration | High | Prefer default Appium settings that we optimize and benchmark. Use custom settings only when you have a specific need and have measured the impact. |
| Device features (battery mocks, special logging, etc.) | Enables additional device‑level features or mocks. | Start time (extra setup), Session duration | Medium | Turn these on only in tests that explicitly verify these features. Keep them off in standard regression runs. |
| Local/custom VPN tunnel options | Adds extra steps for custom VPN/tunnel configurations. | Start time | Medium | If possible, use standard Local Testing settings instead of complex custom VPN options. |
| Orientation changes & frequent screenshots | Rotation and frequent screenshot commands. | Session duration | Medium | Minimize orientation changes (only when the test requires it). Limit screenshots to key checkpoints or failures, instead of every step. |
Summary
To systematically reduce your test times and ensure faster performance, do the following:
Look at your time split
If BrowserStack time is high:
- Focus on Start time, Queuing, and capabilities you’re enabling.
If User time is high:
- Focus on reducing waits, optimising application and third party API calls and remove unnecessary logging
Start with the biggest lever
-
If queues dominate - optimise parallels and choose Tier‑1/broader device sets.
-
If start time dominates - trim capabilities and app size, limit Local Testing usage to only when necessary.
-
If execution dominates - clean up test code, locator strategies, and reduce logs.
Make one change at a time and measure
After each change (e.g. disabling network logs for CI), compare the following parameters using the App Automate dashboard:
- Average start time
- Queuing time
- Session duration
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!