TestNG ERROR在类路径中找不到类 [英] TestNG ERROR Cannot find class in classpath

查看:1090
本文介绍了TestNG ERROR在类路径中找不到类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过命令行运行testng并且我在类路径中有以下内容:

I'm trying to run testng via command line and I have following things in classpath:


  • testng jar,jar编译的测试用例文件以及其他必需的jar。

  • testng.xml 指向层次结构中的适当类。

  • testng jar, jar of compiled test case file, and other required jars.
  • testng.xml points to appropriate class in the hierarchy.

Testng不运行而是抛出:

Testng doesn't run instead it throws:

[TestNG] [ERROR]  Cannot find class in classpath: (name of testcase file)

之前我遇到了同样的问题而且我刚刚添加。

I encountered the same issue before and I just added.

classpath 中它解决了问题。但这一次它似乎没有解决它。有任何变通方法吗?在此先感谢。

In classpath and it solved the problem. But this time it did not seem to solve it. Any workarounds? Thanks in advance.

推荐答案

我刚遇到这个问题而且我非常有信心这是eclipse的TestNG插件中的一个错误因为我能够从命令行运行我的测试就好了。

I just had this problem and I'm pretty confident that it's a bug in the TestNG Plugin for eclipse, since I was able to run my tests from the command line just fine.

对我和其他人来说似乎有用的修复只是为了清理你的项目( Project 清洁)。一个人不得不重新安装整个插件。

The fix that seems to be working for me and others is just to clean your project (ProjectClean). One person had to re-install the whole plugin.

这篇关于TestNG ERROR在类路径中找不到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆