Device Farm
Documentation Home
  • Introduction
  • Project Creation & Setup
  • Getting Started
  • Manual Testing
  • Automation
  • Test-Reports-and-Analysis
  • Element Explorer Feature for Appium Automation Testing
  • Integrations with Collaboration Tools
  • Interrupts
  • Supported Devices and Browsers List
  • Biometric Bypass Feature for Real Devices
  • File Upload Feature for Remote Real Devices
  • Frequently Asked Questions (FAQ)
Powered by GitBook
On this page
  • Running Automation Session
  • Setting Up Automated Tests
  • Configuring Test Parameters
  • Running and Managing Automated Tests

Automation

Last updated 10 months ago

Running Automation Session

Automated testing allows you to leverage Qyrus Device Farm's devices to execute your existing tests, providing comprehensive reporting that includes video recordings, device vitals, and Appium logs.

Prerequisite:

  • Having a project created

  • Uploading an application file

Setting Up Automated Tests

Creating a Automation Device Session

  1. Under Projects, click on “Sessions” for your project

  1. Click on the “Automation” tab and then Click on “Quick Setup Guide”

Configuring Test Parameters

  1. Choose a device to execute the test on

Sort the devices by region, platform, or search for a specific device.

  1. Select an application file to test

    1. Android

      1. Choose the “APK File”

      2. Choose the “App Activity”

    2. iOS

      1. Choose the “IPA File”

  1. Click on “Generate JSON”

Note: This is the JSON generated for the device and application that you picked. This will be copied in to your testing framework

Note: This is the information that will be added to our testing framework.

  1. To run the tests on your framework using the Qyrus infrastructure, provide the desired capabilities in to the testing framework.

Note: This is an example using java to test an iOS device.

Note: This is an example using java to test an Android device.

Running and Managing Automated Tests

  1. Start Automated Tests:

    • Initiate the automated test session by running code in our machine.

    • Qyrus Device Farm will deploy your application and execute the specified Appium tests on the selected devices.

  2. Monitor Test Progress:

    • During the test execution, monitor the progress in real-time through the provided dashboard.

    • Observe device vitals, Appium logs, and video recordings to understand the test behavior.

  3. Access Detailed Reports:

    • Once the test session is completed, access the comprehensive test report.

    • Review device performance metrics, Appium logs, and video evidence for a comprehensive analysis.

Steps to Run the Automated Test

In order to execute the automated tests via JAVA; Launch any JAVA IDE (for eg:eclipse) where the respective framework details can be loaded easily consisting the automated tests.

Note: These capabilities are unique to each device and app chosen while generating a JSON.

Prerequisites:

Before you begin, ensure you have the following software and tools installed:

  • Appium: Make sure you have Appium, an open-source mobile application automation tool, installed on your system. You can download and install Appium from the official website .

  • JAVA 8: Appium requires Java to execute test scripts. Ensure you have Java Development Kit (JDK) 8 installed on your system. You can download JDK 8 from the official Oracle website or use a compatible distribution.

  • JAVA IDE: You'll need a Java Integrated Development Environment (IDE) for writing, editing, and managing your test scripts. Choose a popular Java IDE such as Eclipse, IntelliJ IDEA, or any other of your preference.

These prerequisites are essential to create and execute automated test scripts using Appium and Java. Make sure you have them in place before you start your mobile app testing journey.

Note: This is an example using java to test an Android device.

Steps to RUN Automation via JAVA Example

Copy the JSON generated from the above steps and replace it with coresponding attributes in the below code

JAVA CODE to Test


import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import io.appium.java_client.android.AndroidDriver;

public class DeviceFarmAutomation {
	private AndroidDriver driver;
 
	@BeforeTest
	public void setUp() throws MalformedURLException {
		stagingP30();
	}

	public void stagingP30() throws MalformedURLException {
		DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
		desiredCapabilities.setCapability("deviceName", "*****************");
		desiredCapabilities.setCapability("platformName", "iOS");
		desiredCapabilities.setCapability("automationName", "XCUITest");
		desiredCapabilities.setCapability("platformVersion", "14.4.1");
		desiredCapabilities.setCapability("udid", "*****************"); 
		desiredCapabilities.setCapability("app",
				"<App URL>");
		desiredCapabilities.setCapability("appium:AuthToken", "****************");
		desiredCapabilities.setCapability("appium:Authentication", "****************");
		desiredCapabilities.setCapability("appium:SessionName", "<TestName>");
		URL remoteUrl = new URL("https://stg-mobilecloud-ap-south.quinnox.info/wd/hub");
		driver = new AndroidDriver(remoteUrl, desiredCapabilities);
	}

	@Test(priority = 5)
	public void logout() throws InterruptedException {
		System.out.println(driver.getSessionId());
		Thread.sleep(10000);
		driver.findElement(By.className("android.widget.ImageView")).click();
		driver.findElement(By.className("android.widget.FrameLayout")).click();
		Thread.sleep(10000);
	}

	@AfterTest
	public void tearDown() {
		driver.quit();
   }
}

Note: remoteURL and appium:AuthToken and appium:Authentication are the ones which help setting up the connection with server.

Once the details are saved, click on execute test and go back to automation page in Qyrus DeviceFarm Dashboard. Where you will be able to view the Automation test initiated

The live preview can be viewed.

Note: User will be able to trigger only one session at a time on a particular device.

Note: Appium supported version 1.X ()

Once the session is complete, click on Show Details to view → Device Logs, Device Vitals & Appium Logs.

Download Appium desktop
View Reports
(click here for more information on project creation)
(click here for more information on uploading an application)