问题描述
我们正在与我们的应用程序整合TestNG的,我创建的testng.xml和testngbuild.xml蚂蚁构建。在运行Ant构建它扔在classpath中找不到类:。其实我尝试过很多办法。但我仍然无望。即使我试图复制手动.class文件应用程序的我TestNG的目录。如果你能做到这样的,它是抛出另一个异常是无法加载的.class文件
WE are integrating testng with our application, I created testng.xml and testngbuild.xml for ant build . While running ant build it is throwing Cannot find class in classpath:. Actually I tried many ways. But I am still hopeless. Even I tried copying manually .class file to my testng directory of the application. If you can do like this, It is throwing another exception as could not load .class file
推荐答案
即使我面临同样的问题很多时候。你可以试试下面这为我工作的解决方案。
Even I faced the same problem many a times. You can try below solutions which worked for me.
-
点击特定的项目 - >项目 - >洁净>刷新
Click on specific project ->Project->Clean-> refresh
由于IDE中的其他开放项目。只保留你在打开和关闭其他不相关项目的工作计划。右键单击 - >关闭项目。
Because of other open projects in IDE. Keep only the project you are working on open and close other non related projects. Right click-> Close Project.
你不会相信,有时罪魁祸首是Excel工作表(不知道它是如何相关的)当你拥有它的开放和sepearate实例可能与创建等它关闭和KLL任何进程在运行用Excel表将解决。
And you won't believe sometimes the culprit is Excel sheet(Don't know how it is related) when you have it open and sepearate instance might have created with that etc. Close it and kll any process running with excel sheet will resolve.
这篇关于在使用TestNG类路径问题找不到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!