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

前端 未结 30 1090
礼貌的吻别
礼貌的吻别 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:03

    Project>>Clean and Maven>>Update Project worked for me

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

    This issue can be resolved by adding TestNG.class package to OnlineStore package as below

    1. Step 1: Build Path > Configure Build Path > Java Build Path > Select "Project" tab
    2. Step 2: Click "add" button and select the project with contains the TestNG source.
    3. Step 3 select TestNG.xml run as "TestNG Suite"
    0 讨论(0)
  • 2020-12-09 09:04

    My 2 cents on the problem: I was experiencing the same problem, while some part of my path was in Cyrillic. So check the path to your project for special characters. Once I removed this, the problem was fixed

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

    I came across the same issue stated above today. **setting the class-path again in eclipse ** solved the issue .

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

    You should create package first and then create new TestNG class under that package.

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

    If you use IntelliJ IDEA, try the following:

    1. From 'File', select "Invalidate Caches/ Restart" option.
    2. Confirm this action by clicking the "Invalidate and Restart" button.
    3. Then the IDEA will be restarted.
    4. You will then find a fresh copy of your project.
    5. You then need to import/ change project format to the Maven project. IDEA will show you options at the bottom right corner.
    6. After this, you should be able to run your project.
    0 讨论(0)
提交回复
热议问题