Last updated: Jan 11, 2021 12:18
Prerequisites
Before you get started, make sure you have installed the following:
- Java Development Kit 1.8
- Selenium WebDriver for Chrome (for running the local scripts)
- 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)
1 | Get started
The starting point is LocalSelenium.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 accesses the Perfecto website and verifies the title.
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.
- Download the OS specific chromedriver into the
libs
folder of the project and update thewebdriver.chrome.driver
as applicable. - Run the
LocalSelenium.java
project as TestNG Test.
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, driver details, Smart Reporting information, and test data. We also want to make sure that the script exits gracefully.
The updated script is called PerfectoSelenium.java
. The following procedure walks you through the configuration.
Expand a step to view its content.
Also in this section: