Gradle Issue with TestNG : No tests found for given includes

Viewed 114

I am having difficulties with testNG + Gradle. My tests have worked fine, but I made some changes to the file where I have tests, and now this issue pops up.

"Execution failed for task ':....'.

No tests found for given includes : [.....]

I have this in place, but it doesn't help.

test {
    useTestNG()
}

What does error mean exactly, and how do I resolve it?

1 Answers

I had this same problem when running TestNG tests from within IntelliJ. I've found that many posts recommend changing the "Run test using" setting from "Gradle" to "IntelliJ IDEA" (Settings/Build,Execution, Deployment/Build Tools/Gradle), but this didn't work for me.

I discovered that on the same settings screen my "Gradle JVM" was set to using a newer JVM: "JVM 11" when our code is only compatible with "JVM 1.8". Changing this setting fixed the above error.

Related