Hello!
I’m using Appium automation in gradle in Mac machine. I have build.gradle like below
When I’m running it, I’m getting error like this
Caused by: java.lang.ClassNotFoundException at BuiltinClassLoader.java:641
Execution failed for task ‘:test’.
Can anybody know how to resolve this please?
bash profile :
export JAVA_HOME=“/Library/Java/JavaVirtualMachines/jdk1.8.0_331.jdk/Contents/Home”
buildscript {
repositories {
mavenCentral()
google()
maven {
url = uri(‘Central Repository:’)
url ‘https://jitpack.io’
}
}}
plugins {
id ‘java-library’
id ‘maven-publish’
id “com.avast.gradle.docker-compose” version “0.14.9”
id “com.diffplug.spotless” version “5.17.1”
id “net.serenity-bdd.serenity-gradle-plugin” version “2.5.10”
id “com.gitlab.et.paralleltests” version “1.0.2”
}defaultTasks ‘clean’, ‘test’, ‘aggregate’
repositories {
mavenCentral()
maven {
url “https://jitpack.io”
}
}gradle.startParameter.continueOnFailure = true
dependencies {
implementation ‘io.cucumber:cucumber-java:6.9.1’
implementation ‘net.serenity-bdd:serenity-stats:2.3.12’
implementation ‘cglib:cglib:3.3.0’
implementation ‘org.apache.commons:commons-lang3:3.8.1’
implementation ‘org.seleniumhq.selenium:selenium-api:3.9.1’implementation 'org.seleniumhq.selenium:selenium-java:4.7.0' implementation 'org.seleniumhq.selenium:selenium-remote-driver:4.7.0' implementation 'org.seleniumhq.selenium:selenium-support:4.7.0' implementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.7.0' implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4' implementation 'com.fasterxml.jackson.core:jackson-core:2.13.4' implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.4' implementation 'net.serenity-bdd:serenity-single-page-report:2.3.12' implementation 'com.opencsv:opencsv:5.1' implementation 'io.appium:java-client:8.3.0' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.12.3' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.12.3' implementation 'org.slf4j:slf4j-log4j12:2.0.5' compileOnly 'org.projectlombok:lombok:1.18.24' implementation 'com.googlecode.lambdaj:lambdaj:2.3.3' implementation 'net.serenity-bdd:serenity-core:3.6.9' testImplementation 'io.cucumber:cucumber-junit:6.9.1' testImplementation 'net.serenity-bdd:serenity-cucumber6:2.3.12' testImplementation 'net.serenity-bdd:serenity-screenplay:2.3.12' testImplementation 'net.serenity-bdd:serenity-screenplay-webdriver:2.3.12' testImplementation 'net.serenity-bdd:serenity-junit:2.3.12' testImplementation 'junit:junit:4.13.2' testImplementation 'org.assertj:assertj-core:3.22.0' testImplementation 'org.hamcrest:hamcrest-all:1.3' testImplementation 'com.saucelabs:saucerest:1.0.23' annotationProcessor 'org.projectlombok:lombok:1.18.24'
}
group = ‘nz.com.twg.mobile.twl’
version = ‘1.0.0-SNAPSHOT’
description = ‘TWL Mobile Serenity project using Cucumber and WebDriver’
java.sourceCompatibility = JavaVersion.VERSION_1_8publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}tasks.withType(JavaCompile) {
options.encoding = ‘UTF-8’
}tasks.withType(Javadoc) {
options.encoding = ‘UTF-8’
}
spotless {
java {
removeUnusedImports()
importOrder()
googleJavaFormat()
}
}dockerCompose {
useComposeFiles = [‘docker/docker-compose-chrome.yml’]
captureContainersOutput = true
forceRecreate = true
}task installGitHooks(type: Copy) {
from ‘hooks’
into ‘.git/hooks’
fileMode 0755
}build {
dependsOn clean, spotlessApply, installGitHooks
}