当我运行Maven中使用此命令一个测试:在maven中运行单个测试 - >没有执行测试!
mvn test -Dtest=InitiateTest
我得到以下结果:
No tests were executed!
它的工作几分钟前,但现在它停止工作一些原因。在运行测试之前,我尝试了几次运行mvn clean
,但没有帮助。
测试看起来是这样的:
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class InitiateTest {
public static FirefoxDriver driver;
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
}
@Test
public void initiateTest() throws Exception {
driver.get("http://localhost:8080/login.jsp");
...
}
@After
public void tearDown() throws Exception {
driver.close();
} }
UPDATE:
它加入这个依赖于POM造成的:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium</artifactId>
<version>2.0b1</version>
<scope>test</scope>
</dependency>
当我删除它,一切正常罚款。一切工作正常,即使我添加这两个依赖项,而不是上一个:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>2.0b1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.0b1</version>
<scope>test</scope>
</dependency>
这很奇怪。
你想运行什么样的考验?你没有任何机会放置@Ignore? – Navi 2011-01-10 10:59:09
可能不太有用..但请记住,这两个都是测试版产品,并大大受到破坏。 – mezmo 2011-01-10 20:35:35