Aug 22, 2019 in Selenium
Q: How can we create a data-driven framework using TestNG?

1 Answer

0 votes
Aug 22, 2019
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
Click here to read more about Selenium
Click here to read more about Insurance

Related questions

0 votes
Aug 19, 2019 in Selenium
...