By using @DataProvider annotation, we can create a Data Driven Testing Framework.
@DataProvider(name="getData")
public Object[][] getData(){
//Object [][] data = new Object [rowCount][colCount];
Object [][] data = new Object [2][2];
data [0][0] = "FirstUid";
data [0][1] = "FirstPWD";
data[1][0] = "SecondUid";
data[1][1] = "SecondPWD";
return data;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@DataProvider(name="getData")
public Object[][] getData(){
//Object [][] data = new Object [rowCount][colCount];
Object [][] data = new Object [2][2];
data [0][0] = "FirstUid";
data [0][1] = "FirstPWD";
data[1][0] = "SecondUid";
data[1][1] = "SecondPWD";
return data;
}
Practical Example