Junitがテストメソッド/セレンテストケースを順番に呼び出さないようにしたいと思います。しかし、私は特定のテストケースを実行したい、または私の必要性に応じて呼び出す必要があります。Junitのテストケース呼び出し機能をカスタマイズする方法
例コード:
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
public class demo2 {
Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.co.in/");
selenium.start();
selenium.setTimeout("6000");
}
@Test
public void test_3() throws Exception {
selenium.open("/");
selenium.type("q", "3");
}
@Test
public void test_4() throws Exception {
selenium.open("/");
selenium.type("q", "4");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
注
私はメソッドのtest_3をしたい、test_4 ....状況に応じて呼び出されなければなりません。