0

我最近在 eclipse 中配置了 Web-driver 并且还配置了 ant 并且我能够执行一个项目。最近我又创建了 1 个项目并编写了第一个 Java 代码,当我单击运行按钮时,即使没有错误,它也无法执行它。这是我尝试执行时抛出的错误。

Class not found Dashboard
java.lang.ClassNotFoundException: Dashboard
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at     org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
4

1 回答 1

0

确保你的类路径中有 selenium-java-2.x.jar 和 JUnit/TestNG jar。还要确保您的测试在类路径中。要设置类路径,请右键单击Project -> Properties -> Java Build Path -> "Add JARs" 或 "Add External JARs"

于 2013-09-30T10:25:40.687 回答