问题描述
我有由框架创建的测试类
I have test class created by framework
import org.selenium.MainTestCase;
public class Test01 extends MainTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
startSeleniumSession("RemoteWebDriver", "http://102.0.0.01:8080/hello/");
}
public void testMethod() throws Exception {
session().open("/hello/request.co","");
session().selectFrame("top_frame");
session().type("id=lgn:username","test");
session().type("id=lgn:password","test");
session().click("id=lgn:submit");
session().waitForFrameToLoad("top_frame","");
}
@Override
public void tearDown() throws Exception {
super.tearDown();
}
}
我有蝙蝠文件
javac -cp .\lib\* Test01.java
java -cp .\lib\* org.junit.runner.JUnitCore Test01
在lib文件夹中,我拥有所有为我生成Test01
类的jar和框架.
In lib folder I have all jars and framework which generated Test01
class for me.
运行bat文件时,我得到了结果:
When I run my bat file I got result:
JUnit版本4.10找不到Coul类:Test01时间:0,002确定(0个测试)
JUnit version 4.10Coul not find class: Test01Time: 0,002OK(0 tests)
类和库的结构是:
根文件夹-dist
lib
文件夹(在dist
下)-我所有的库都放在其中
lib
folder(under dist
) - where all my libs placed
在dist
文件夹中,我有Test01.class
和Test01.java
和run.bat
In dist
folder I have Test01.class
and Test01.java
and run.bat
推荐答案
您需要使用.
将当前目录添加到类路径.在基于Windows的系统上,用;
分隔文件夹,而在基于Unix的系统上,用:
分隔.
You need to add your current directory to the classpath with a .
. On windows-based systems you separate folders with a ;
while on a unix-based systems you separate with a :
.
Windows示例:my/path/1;.
(添加路径my/path/1
和当前目录)
Windows Example : my/path/1;.
(Adds path my/path/1
and the current directory)
Unix示例:my/path/1:.
(添加路径my/path/1
和当前目录)
Unix example: my/path/1:.
(Adds path my/path/1
and the current directory)
这篇关于找不到类JUNIT org.junit.runner.JUnitCore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!