I don't want the Junit to call my test methods/selenium testcases sequentially. But i want the particular testcase to execute or it should get called as per my need.
Example code:
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();
}
}
Note
I want the the methods test_3,test_4.... should be called depending on the condition.