org.testng.TestNGException: Cannot find class in classpath - Testng & GEB

148 views
Skip to first unread message

Mani

unread,
Jun 29, 2020, 3:48:07 AM6/29/20
to Geb User Mailing List
I created a framework with testng & GEB. (groovy)

When I executed as testng suite, I'm getting

Cannot find class in classpath: com.Daca.Smoke.GoogleTest
    at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
    at org.testng.xml.XmlClass.init(XmlClass.java:73)
    at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
    at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:556)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)


I tried all the solution given in google such as cleaning the project etc.(I've done the same in testng, java & selenium it worked well)

For groovy, testng & GEB i couldn't resolve it.

Thomas Hirsch

unread,
Jun 29, 2020, 4:18:08 AM6/29/20
to Geb User Mailing List
Hello Mani, 

how are you executing this?
Are you using Gradle?
Are you starting the tests from an IDE?
Can you show your build.gradle file?

Best regards, 
Thomas

Mani

unread,
Jun 29, 2020, 4:27:40 AM6/29/20
to Geb User Mailing List
Hi Thomas,

I am not using gradle. (Using Maven)

I'm using testng xml where i've given the package & class name of the groovy script as mentioned. I'm running testng.xml from eclipse IDE.

Note: I'm new to GEB and trying to integrate GEB with Testng.(Maven)

Regards,
Mani.

Marcin Erdmann

unread,
Jun 29, 2020, 4:57:12 AM6/29/20
to geb-...@googlegroups.com
Hi Mani,

I'm afraid that you are providing so little information that it's virtually impossible to help you. What's more, the error you posted has nothing to do with Geb, it looks like a classpath issue related to TestNG execution.

Can you share your test project by uploading it to Github so that people can at least have a look at what might be wrong in your setup?

Cheers,
Marcin

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/6931a7c0-4a44-4455-94f9-527375de8e16o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages