Automation
Running Automation Sessions
Automated testing allows you to leverage Qyrus Device Farm's real Android and iOS devices to execute your automated test scripts at scale. During and after execution, Device Farm provides comprehensive reporting that includes real-time live previews, video recordings, time-series device vitals, Appium logs, and device system logs.
Prerequisites:
A Qyrus Device Farm project created (click here for project creation)
Application binary uploaded to the project (click here for application upload)
Appium: Appium client and server (supports Appium 1.x and Appium 2.x)
Development Environment:
Java: JDK 8, 11, or 17+ with an IDE (Eclipse, IntelliJ IDEA, VS Code) and build tool (Maven/Gradle).
Python (Optional): Python 3.8+ with
Appium-Python-Clientandpytest/unittest.JavaScript/TypeScript (Optional): Node.js with WebdriverIO or
webdriverio/appium.
Setting Up Automated Tests
Creating an Automation Device Session via Quick Setup:
Under Projects, click on “Sessions” for your project:

Click on the “Automation” tab and select “Quick Setup Guide”:

Configuring Test Parameters & Capabilities
Choose a Device: Filter devices by region, platform (Android / iOS / Cloud), brand, or search by model.

Select Application File:
Android: Select the uploaded
.apk,.apks, or.aabfile. The tool automatically detects the App Package and allows selecting the initial launch App Activity.iOS: Select the uploaded
.ipafile.

Click “Generate JSON”:
The interactive CodeMirror editor outputs the JSON capabilities formatted for your testing framework.


Add Capabilities into Your Framework:
Copy the generated capabilities and paste them into your test framework setup method.


Cloud Device Farm (AWS) Automation
For devices running on AWS Device Farm cloud infrastructure:
Generate the Cloud Device payload from the Remote Devices tab in Project Setup.
Start the automation session using the REST API endpoint:
POST /device-farm/automation/provider/start?projectId=<ProjectToken>
Execute your Appium test suite targeting the cloud endpoint.
Stop the session using the endpoint:
POST /device-farm/automation/provider/stop?projectId=<ProjectToken>
Code Examples
1. Java (TestNG & Appium)

Note:
remoteUrl,appium:AuthToken(Project Token), andappium:Authentication(User API Token) authenticate and route your test traffic securely to the target real device.
2. Python (Appium-Python-Client & PyTest)
3. JavaScript / TypeScript (WebdriverIO)
Running and Managing Automated Tests
Start Automated Tests: Run your test script from your local machine, IDE, or CI/CD pipeline (Jenkins, GitHub Actions, GitLab CI).
Monitor Live Execution:
Switch to the Automation tab in the Device Farm dashboard.
The running test appears with a live stream preview card and real-time execution status (
Running,Completed,Failed).


Live Appium Logs: Click on the active session to view live Appium streaming logs to debug commands and element locators as they execute.
Access Detailed Reports: Once execution finishes, click Show Details to view the comprehensive test report containing Appium logs, device system logs, device vitals graphs, screenshots, and video recordings. Learn more about Test Reports.
Last updated