Recently i have worked on that, so find the below code to understand the solution..
The below code used to read the data from excel sheet and returns the array.
@DataProvider(name = "PegaDataPool")
public Object[][] createDataPool(Method testMethods) {
ExcelReader readExcel = new ExcelReader();
List<
String> tableName = new LinkedList();
if (testMethods.getName().equalsIgnoreCase("testNewCaseRegistration")) {
tableName.add("pegaUserData");
Object[][] retObjArr = readExcel.getTableArray("C:/workspace/VTAF-4.0/src/TestData/PegaTestData.xls","Pega User", tableName);
return (retObjArr);
}
return null;
}
you can use above values in the below methods
@Test(dataProvider = "PegaDataPool")
public void testNewCaseRegistration(String branch, String enquiryAmount,String debitAmount, String transactionDate, String tableName)throws Exception {
these branch, enquiryAmount variables can use whenever you require the data present in it.
}
Please find the attachment to know the data present in excel sheet.
Hope it will be useful to u...