Last updated: Jan 11, 2021 12:13
Prerequisites
Before you get started, make sure you have installed the following:
- Java Development Kit 1.8
- An IDE of your choice, such as Eclipse or IntelliJ IDEA
- If you work with Eclipse, TestNG for Eclipse and the Maven plugin
- If you work with IntelliJ IDEA, the Maven plugin
- Maven (download and install)
- Android Studio
- Local Appium server, running at http://127.0.0.1/, port 4723
For more information, see this introduction to Appium. For information on the Appium versions Perfecto supports, see the Selenium/Appium versions tab in the Supported platforms article.
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.
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:
- Access the sample project in GitHub and copy the clone URL: https://github.com/PerfectoMobileSA/PerfectoJavaSample
- Open your IDE and check out the project from GitHub.
- 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.
Also in this section: