Suppose I have a set of test cases, and I first open one url, and run the test:
@BeforeMethod
@Parameters("browser")
public void start(String browser) throws Exception {
driver = new FirefoxDriver();
driver.get(url);
}
@Test(dataProvider = "TestA", dataProviderClass = xxx.class)
public void TestA(String VariableA1, String VariableA2..){
}
@Test(dataProvider = "TestB", dataProviderClass = xxx.class)
public void TestB(String VariableB1, String VariableB2..){
}
@Test(dataProvider = "TestC", dataProviderClass = xxx.class)
public void TestC(String VariableC1, String VariableC2..){
}
And I want to run the same set of test cases on different url which also stored in one of the table from the dataprovider. How can I design to achieve this logic?:
- get a url urlX from the url table in the excel dataprovider.
- run test: TestA, TestB, TestC.
- then get url urlY from the url table in the excel dataprovider.
- run test: TestA, TestB, TestC...
- so on so forth..
How can I achieve that?
Thank you!