Gradle
Gradle is an open-source build automation tool that is flexible enough to build any type of software. This section walks you through setting up Gradle with Perfecto.
A sample Gradle with Perfecto project is available here: https://github.com/PerfectoMobileSA/Perfecto_Gradle
On this page:
For more information on Gradle, see Integrate Gradle with Perfecto Smart Reporting.
Requirements
Perfecto supports Gradle 7.x and earlier.
Set up Gradle with Perfecto
-
Download and install JDK 8.
-
Set up the JAVA_HOME environment variable to point to the JDK 8 installation folder.
-
Set up Gradle on a Windows or Mac machine by following the instructions at https://gradle.org/install.
-
To verify that the installation is successful, launch a new command line window and run the following command:
Copygradle -v
-
Import your existing Gradle project into your IDE, or create a new project.
-
Update your
build.gradle
file with the following repositories:Copyrepositories {
mavenCentral()
maven {
url 'https://repo1.perfectomobile.com/public/repositories/maven'
}
} -
Add the following dependencies:
CopyGradle dependencies
compile ('com.perfecto.reporting-sdk:reportium-java:+') {
exclude group: "org.seleniumhq.selenium", module: "selenium-remote-driver" exclude group: "org.seleniumhq.selenium", module: "selenium-java" exclude group: "org.seleniumhq.selenium", module: "selenium-api" }
compile 'com.perfectomobile:http-client:+'
compile 'com.perfectomobile:pm-webdriver:+'
compile group: 'org.seleniumhq.selenium', name: 'selenium-server', version: '3.14.0'
compile 'org.seleniumhq.selenium:selenium-api:3.14.0'
compile 'org.seleniumhq.selenium:selenium-remote-driver:3.14.0'
compile 'org.seleniumhq.selenium:selenium-support:3.14.0'
compile 'commons-codec:commons-codec:1.10'
compile 'commons-io:commons-io:2.4'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'dom4j:dom4j:1.6.1'
compile 'com.google.code.gson:gson:2.5'
compile 'com.google.guava:guava:19.0'
compile 'org.apache.httpcomponents:httpclient:4.5.1'
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.0'
compile 'io.appium:java-client:3.3.0'
compile 'jaxen:jaxen:1.1.6'
compile 'org.slf4j:jcl-over-slf4j:1.7.16'
compile 'org.json:json:20151123'
compile 'ch.qos.logback:logback-classic:1.1.5'
compile 'ch.qos.logback:logback-core:1.1.5'
compile 'org.slf4j:slf4j-api:1.7.16'A sample
build.gradle
file, including all Perfecto and Smart Reporting dependencies, is available here: https://github.com/PerfectoMobileSA/Perfecto_Gradle/blob/master/build.gradle -
To confirm that the dependencies have downloaded properly, execute the following gradle task:
Copyclean build