I'm using a data provider with test-ng and I want the particular test to follow a series of steps for each of the elements within the data collection object.
The test:
For each element in the object, validate the form can input the values
The process therefore has the following:
- Open a web page (from the data)
- Check if element exists on the page
- Input the values
I have tried to use the following below, however, for each of the elements in the object it runs step 1 and then moves onto step 2 after, rather than following the process. I'm therefore asking whether or not it's possible to do a 'test step' approach using test-ng?
If there are 2 values in the Data
it will execute Open
twice and then move on to CheckElementExists
@Test (priority = 1, dataProvider = "Data")
public void Open(Data data) throws InterruptedException
{
System.out.println("Step 1");
this.module.open(data);
}
@Test (priority = 2, dataProvider = "Data")
public void CheckElementExists(Data data)
{
System.out.println("TWO");
}