Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium 蚂蚁找不到symbol@Test_Selenium_Ant_Junit - Fatal编程技术网

Selenium 蚂蚁找不到symbol@Test

Selenium 蚂蚁找不到symbol@Test,selenium,ant,junit,Selenium,Ant,Junit,我试图编译下面的类,其中只有一个函数 公共类遗嘱说明{ @Test public void testLogin(){ System.out.println("Testing Login"); } 当我以JUNIt运行该文件时,它可以工作,但当我尝试从build.xml运行该文件时,它会给我以下错误:找不到symbol@Test。我确实在正确的位置有JUNIt.jar文件。这是我的build.xml脚本: ant成功地构建了项目,但在编译时失败了您可能需要将jUnit库添加到

我试图编译下面的类,其中只有一个函数

公共类遗嘱说明{

@Test
public void testLogin(){
    System.out.println("Testing Login");
}
当我以JUNIt运行该文件时,它可以工作,但当我尝试从build.xml运行该文件时,它会给我以下错误:找不到symbol@Test。我确实在正确的位置有JUNIt.jar文件。这是我的build.xml脚本:



ant成功地构建了项目,但在编译时失败了

您可能需要将jUnit库添加到类路径中,以便ant知道它在哪里

...
<classpath path="path/to/your/junit.jar"/>
...
。。。
...

@Shabeer你也可以看看这个模板:谢谢你把junit.jar路径放在classpath中。谢谢。我遇到了另一个问题。我试图在我的脚本中使用IEDriver,但当我在ant中编译时,我得到了错误:错误:package org.openqa.selenium.ie不存在。请问我如何解决这个问题
...
<classpath path="path/to/your/junit.jar"/>
...