Skip to main content
🚀 Self Healing AI Agent now live in App Automate! Auto-fix flaky tests instantly with zero code changes. Enable now!
No Result Found
Connect & Get help from 6000+ developers on our Discord community. Ask the CommunityAsk the Community

BrowserStack Appium FAQs

Frequently asked questions (FAQs) for BrowserStack Appium users

This FAQ section addresses common questions about BrowserStack Appium, helping you troubleshoot issues and understand key features. The questions are organized by topic to help you quickly find the information you need.

If you can’t find the answer to your question here, you can contact our support team for additional assistance.

Troubleshooting long Appium sessions on iOS

What is test sharding and how does it help with Appium stability?

Parallel test sharding (recommended)

  • Shard your test suite: Run different subsets of your test suite simultaneously across multiple devices.
  • Example: Each device handles a fraction of the load (e.g., 40 tests instead of 200), keeping session duration under safe OS limits (under 45 minutes).

Example TestNG configuration:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="iOS Regression Suite" parallel="tests" thread-count="5">
    <test name="Onboarding Tests - Device 1">
        <parameter name="device" value="iPhone 14"/>
        <classes>
            <class name="com.tests.Onboarding"/>
        </classes>
    </test>
    <test name="Payment Tests - Device 2">
        <parameter name="device" value="iPhone 13"/>
        <classes>
            <class name="com.tests.Payments"/>
        </classes>
    </test>
</suite>

Why this works: Each device only handles a subset of tests, reducing session duration and improving stability.

What Appium settings can I optimize for long sessions?

Optimize Appium settings

  • Disable video recording if not needed to save processing power.
  • Reduce log level: Set Appium log levels to info or warn instead of debug for production runs.

Why does my app background or terminate during long Appium sessions on iOS?

Problem: When running large regression suites (e.g., 200+ tests) on real iOS devices, the application may unexpectedly move to the background or terminate after 60–90 minutes of execution, even if individual tests pass in isolation.

Common symptoms:

  • The app minimizes or closes without a specific Appium error code.
  • Crash logs (if retrieved) show EXC_RESOURCE, wakeups, or high memory warnings.
  • The device appears sluggish in video recordings towards the end of the session.

Root cause: Real iOS devices have strict OS safeguards (Watchdogs) to preserve battery and system health. Long-running automation sessions can trigger the iOS Watchdog, causing the OS to forcibly run in the background or kill the process.

How can I prevent app backgrounding or termination in long Appium sessions?

Session batching (restarting the driver)

  • Group your tests: Split your test list into batches (e.g., 10 groups of 20 tests).
  • Lifecycle hook: Use your test runner’s @AfterClass or @AfterAll hook to tear down the driver.
  • Re-initialize: Use @BeforeClass to start a fresh installation for the next batch.

Why this works: Restarting the Appium driver every 20–30 tests clears the application cache, dumps temporary logs, and resets the iOS Watchdog timer.

Why does Visual Studio crash with ArgumentOutOfRangeException even though my tests pass on the BrowserStack Dashboard?

Symptom: Tests complete successfully on the BrowserStack infrastructure, but the local Visual Studio Test Explorer crashes during the “cleanup” or post-processing phase. The error log shows:

Unhandled exception. System.ArgumentOutOfRangeException: Index was out of range… at Newtonsoft.Json.Linq.JContainer.GetItem.

Cause: This is typically a local metadata parsing error. It occurs when the BrowserStack Test Adapter attempts to read test result files using a version of the Appium.WebDriver or .NET runtime that has conflicting JSON handling logic.

Resolution:

  • Update Appium.WebDriver: Upgrade the Appium.WebDriver NuGet package to the latest stable version (e.g., v5.0.0+). This usually resolves the index mismatch.
  • Check .NET Compatibility: If you are using .NET 9.0, try downgrading the project to .NET 8.0 (LTS). Some newer runtimes change how file-system watchers report data, which can trigger this exception in the Test Adapter.
  • Refresh Dependencies: Ensure BrowserStack.TestAdapter and NUnit3TestAdapter are updated to their latest versions to ensure compatibility with Visual Studio 2026.

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