Skip to main content
No Result Found
Connect & Get help from 6000+ developers on our Discord community. Ask the CommunityAsk the Community

Run tests

Learn how to execute your mobile test automation scripts using Test Companion.

After Test Companion generates automation code for your mobile app, you need to run it. There are several ways to execute your tests depending on your setup, and Test Companion can help with each approach from running the tests itself to helping you configure an execution environment from scratch.

Understand your options

When Test Companion finishes generating mobile automation scripts, it checks whether your project already has a test execution setup. Based on what it finds, it presents the appropriate options:

Situation What happens
You have an existing setup Test Companion detects your existing configuration (local Appium server, BrowserStack App Automate integration, or another CI-connected setup) and uses it to run the tests.
You do not have a setup yet Test Companion offers to help you configure one. It walks you through the options and sets up the necessary files and dependencies.

Option 1: Run on BrowserStack App Automate

This is the recommended approach. Your tests run on real devices in BrowserStack’s cloud, no local device, emulator, or Appium server required.

How it works:

  1. Test Companion generates the automation scripts with BrowserStack-compatible desired capabilities already configured (using the BrowserStack Username and Access Key from your Chat Settings.
  2. The AI uploads your app to BrowserStack (if not already uploaded) and sets the app capability to point to the uploaded build.
  3. The tests execute on real devices in the BrowserStack device cloud.
  4. Results, including logs, screenshots, and video recordings, are available in the BrowserStack App Automate dashboard and summarised by the AI in the chat.

Example prompt:

Run the tests in tests/mobile/test_checkout.py on BrowserStack. 
Use a Samsung Galaxy S24 with Android 14 and an iPhone 16 with iOS 18.

Running tests on BrowserStack App Automate requires an active App Automate license on your BrowserStack account. If you do not have one, Test Companion will notify you and suggest alternative options.

Option 2: Run locally

If you have a local test execution environment, an Appium server connected to a physical device or emulator/simulator, Test Companion can run the tests using your local setup.

How it works:

  1. Test Companion generates the automation scripts with capabilities pointing to your local Appium server (typically http://localhost:4723).
  2. The AI triggers the test runner (Pytest, TestNG, XCUITest, or whichever framework you are using) from the IDE terminal.
  3. Results appear in the terminal output and are summarised by the AI in the chat.

For this to work, you need:

  • An Appium server running locally (for Appium-based frameworks)
  • A connected device or running emulator/simulator
  • The app installed on the device (or the .apk/.ipa path configured in capabilities)

Option 3: Let Test Companion set up the environment

If you do not have any test execution environment configured and are starting from scratch, Test Companion can help you set one up. When the AI detects that no setup exists, it offers options such as:

  • Set up a local Appium environment: The AI provides step-by-step instructions and generates configuration files for running Appium locally with an emulator or physical device.
  • Set up BrowserStack App Automate: The AI generates the BrowserStack SDK configuration, capability files, and any necessary wrappers, so your tests run in the cloud.
  • Other: If you use a different execution platform or CI system, describe it and the AI will help you configure the integration.

Example prompt:

I have never run mobile tests before. Help me set up BrowserStack 
App Automate so I can run the Appium + Python tests you just 
generated. I am using Pytest as my test runner.

After the tests run

Regardless of which option you use, Test Companion provides a summary of the results:

  • Total tests run, passed, failed, and skipped.
  • For each failure: the test name, the error message, and a brief analysis of the likely cause.
  • If running on BrowserStack: a link to the session in the App Automate dashboard where you can view the full video recording, device logs, network logs, and screenshots.

Run tests across multiple devices

Mobile testing often requires verifying that your app works across a range of devices and OS versions. You can ask Test Companion to run your tests on multiple device configurations based on your BrowserStack App Automate subscription in a single request.

Summarise the results in a table showing pass/fail per device, and highlight any device-specific failures. When running on BrowserStack, these tests can execute in parallel on different devices, significantly reducing the total execution time.

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