Error: org.testng.TestNGException: Cannot find class in classpath: EmpClass

前端 未结 30 1091
礼貌的吻别
礼貌的吻别 2020-12-09 08:17

When i\'m trying to run the test suite, am getting this exception. We are using maven project here and i am done with refreshing, cleaning, reinstalling testNG and then impo

相关标签:
30条回答
  • 2020-12-09 09:06

    In my case I imported maven project as Default existing project in eclipse.After that I imported as maven project.That worked for me.

    0 讨论(0)
  • 2020-12-09 09:07

    I also got the same exception:

    I tried the following steps:

    1. In Eclipse> Project > Clean. (The Exception remained)

    2. I ran another project(The testng.xml ran successfully)

    After running another project, I ran the project in which I was getting the Exception, and fortunately it worked for me, with no errors.

    0 讨论(0)
  • 2020-12-09 09:07

    In testng.xml file, remove "." from tag "" class name if you are not using packages.

    0 讨论(0)
  • 2020-12-09 09:08

    In my opinion if src has test/java/ folders then in build path out location should be like target/test-classes.

    If src has main/java/ folders then in build path out location should be like target/classes.

    0 讨论(0)
  • 2020-12-09 09:09

    I had the same issue when i was using selenium 3.11.xx dependency however my problem was resolved when i used selenium 3.4.x dependency.

    0 讨论(0)
  • 2020-12-09 09:09

    For me it was that I added Skip Tests checkbox/flag in the Maven Build of the Project

    Therefore the test classes weren't compiled and then weren't found by TestNG

    0 讨论(0)
提交回复
热议问题