I am working on data driven testing, currently i am stuck on @Test. I want to pass the data to two different data providers and want to run one of the @test only once. How can i achieve this. Below is the same code describing my situation
@DataProvider(name = "dp")
public Object[][] createData(Method m) {
System.out.println(m.getName()); // print test method name
return new Object[][] { new Object[] { "Cedric" }};
}
@Test(dataProvider = "dp")
public void test1(String s) {
}
@Test(dataProvider = "dp")
public void test2(String s) {
}
here i want to run first @Test to run only once.Isthere any way through which this is possible?