简体   繁体   中英

How to prevent Intellij from showing me the org.testng.TestNGException (Test framework quit unexpectedly)

I'm having the exception below when trying to run tests individually in intellij. The tests I'm trying to run are written in a project built with Ant. The Ant target that runs all unit tests from the projects runs successfully, with no exception. The exception appears when I try to run a class of tests or a test individually.

*org.testng.TestNGException: 
Cannot find class in classpath: com.project.test.Test
    at org.testng.xml.XmlClass.loadClass(XmlClass.java:74)*

Is there a way to configure intellij so that it is able to access the build directory and find the jars it needs? I'm using the latest version of Intellij.

Usually in Eclipse, we need to add TestNG library (just like jre/jdk) in classpath/buildpath to run classes. So try same.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM