Skip to main content

Device Connectivity and Test Execution

After a device has been allocated and connection details are retrieved, it must be connected via ADB to enable automated testing. Once connected, the device can be used with Playwright to perform browser automation tasks. This section outlines the steps to establish the connection, execute test cases, and perform parallel execution on Android devices using Playwright.

Connecting the Device via ADB

To establish a connection to the allocated device, run the following command:

adb connect <remoteConnectUrl>

Once connected, the device becomes available for automation through Playwright.

Execute Test Cases Using Playwright

After establishing the ADB connection, bind the device to Playwright and perform the required automation actions. Typical tasks include:

  • Launching the mobile Chrome browser

  • Navigating to test URLs

  • Performing UI validations

  • Collecting logs and screenshots

  • Running tests in parallel using Playwright Test parallelism

The exact implementation may vary depending on your Playwright automation framework.

Post-Execution Steps

Once automated tests are completed, it is important to properly disconnect the device and release it back to the AstroFarm pool. This ensures that devices are available for other users and maintains the integrity of the device pool.

Disconnect Device from ADB

After test execution, disconnect the device using the following command: adb disconnect <remoteConnectUrl>

Release the Device in AstroFarm

Return the device to the AstroFarm pool so it can be used by other users.

API: DELETE api/v1/user/devices/{serial}

Sample Response:

{
"message": "Device released successfully",
"status": "success"
}

Once released, the device becomes available for allocation to other automation sessions.