Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

TestNG Parameterization Using DataProviders

Category: TestNG
@Test (dataProvider=""getData"")
    // Number of columns should match the number of input parameters
 public void loginTest(String Uid, String Pwd){
 System.out.println(""UserName is ""+ Uid);
 System.out.println(""Password is ""+ Pwd);
 }

@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;
 
 }

Leave a Reply

Your email address will not be published. Required fields are marked *