Cannot find class in classpath issue with TESTNG

跟風遠走 提交于 2019-12-11 03:22:37

问题


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


回答1:


Even I faced the same problem many a times. You can try below solutions which worked for me.

  1. Click on specific project ->Project->Clean-> refresh

  2. 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.

  3. 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.



来源:https://stackoverflow.com/questions/9908809/cannot-find-class-in-classpath-issue-with-testng

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!