Appium

How to run your Java Appium script in Perfecto

This section provides instructions on how to run Appium Driver tests with Java in Perfecto. It assumes that you:

  • Are familiar with Appium
  • Have existing tests to work with
  • Are a novice user of Perfecto

To run your tests in Perfecto, you need to modify your existing scripts to include:

  • What driver you want to use
  • Where your Perfecto instance is located 
  • Who you are
  • What devices you want to work on

We provide two versions of the same script to help you understand how you can modify your existing scripts to run them in Perfecto: LocalAppium.java and PerfectoAppium.java

Note

For information on running the final script, see the README.md file included with the sample project.

Prerequisites

Before you get started, make sure you have installed the following:

1 | Get started

The starting point is LocalAppium.java, a short Java script with Maven dependencies. The pom.xml file is institutional here because it holds all configurations and dependencies. In its initial state, the file is very simple.

Note

We have simplified the script intentionally. It only serves the purpose of showing you how to connect to Perfecto.

The script connects to an emulator, opens the Settings app on an Android device, and verifies whether the Data usage screen is present.

To get started: 

  1. Access the sample project in GitHub and copy the clone URL: https://github.com/PerfectoMobileSA/PerfectoSampleProject
  2. Open your IDE and check out the project from GitHub.
  3. Run the script to make sure it executes without any issues.

2 | Configure the script for Perfecto

In this step, we update the pom.xml file with the required Perfecto dependencies and modify the script from Step 1 to add in security information, the Perfecto cloud name, Smart Reporting information, and test data. We also want to make sure that the script exits gracefully.

The updated script is called PerfectoAppium.java. The following procedure walks you through the configuration.

Expand a step to view its content.