Appium

To learn how to run Appium Driver tests with Java in Perfecto, review the following information. To learn about Appium 2, including how to use an Appium 2-compliant client with Perfecto, see also our free Appium 2.0: Fundamentals course on the Perfecto Education site. To register for this course, you must be logged in. For upgrade information, see Upgrade to an Appium 2-compliant client.

To run a Java Appium script in Perfecto, you should:

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

The setup process involves modifying 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
Important: This document includes references to third-party products, Eclipse IDE and IntelliJ IDEA. The user interface and usage of third-party products are subject to change without notice. For the latest published information about Eclipse IDE, see https://www.eclipse.org/documentation. For the latest published information about IntelliJ IDEA, see https://www.jetbrains.com/help/idea/getting-started.html.

Prerequisites

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

  • Java 11
  • An IDE of your choice, such as Eclipse or IntelliJ IDEA (consider using IntelliJ IDEA)
  • Maven
  • Android Studio
  • Local Appium Server running at http://127.0.0.1 , port: 4723
  • Eclipse users should also install:

  • IntelliJ IDEA users should also install the Maven plugin for IDEA

    IntelliJ IDEA versions 7 and later include the TestNG plugin as a built-in plugin.

Optional installations

For source control management, you can install git.

Appium limitations

Perfecto is aligned with Appium and, therefore, does not support using the clipboard for copy-paste operations on real devices.

For reference, see the Appium information for the custom command extensions mobile: setPastboard and mobile: getPastboard.

1 | Get started

  1. Access the sample project in GitHub and copy the clone URL: https://github.com/PerfectoMobileSA/PerfectoJavaSample
  2. Open your IDE and check out the project from GitHub.

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.

The script uses a sample application that is in the lib of the project:

You can choose to skip this and immediately start using your own application by adding the application manually to your repository and then referencing it in the code.

Important: If you choose to use your own application, these pre-written steps will not work. Instead, we will just check that your app is launching. This will serve as a verification for the entire setup.

Expand a step to view its content.