@just-passin-thru
I was not able to use the Test Data to do it. But I added code in the Test Listener to save to the Excel file. As soon as the TC is done for that iteration, I use the ID created for the account and a Pass/Fail Variable and save it to the Test file. So the Datafile is updated after every iteration. Below is the code on how I do it in Test Listener. I search for the row in the Test File using one of the values in the variables, in my case below it is the email. Hope this helps.
@AfterTestCase
def sampleAfterTestCase(TestCaseContext testCaseContext, TestData testData) {
String accexcel=“C:\xxxx\xx.xlsx”
String ContractNumber = GlobalVariable.ContractNumber
String PassFail
String ErrorMsg = GlobalVariable.ErrorMsg
switch (testCaseContext.getTestCaseStatus()) {
case 'FAILED':
PassFail = "Fail";
break
case 'ERROR':
PassFail = "Fail";
break
case 'PASSED':
PassFail = "Pass";
break
}
XSSFWorkbook workbook1 = ExcelKeywords.getWorkbook(accexcel)
XSSFSheet sheet1 = ExcelKeywords.getExcelSheet(workbook1, "ISA Bulk Certification")
String studentEmail = testCaseContext.getTestCaseVariables().get("StudentEmail")
int rowIndex = ExcelKeywords.getRowIndexByCellContent(sheet1, studentEmail, 5)
if (ContractNumber == null) { ContractNumber = "Student is not created" }
ExcelKeywords.setValueToCellByIndex(sheet1, rowIndex, 0, ContractNumber)
ExcelKeywords.setValueToCellByIndex(sheet1, rowIndex, 1, PassFail + " - " + ErrorMsg)
ExcelKeywords.saveWorkbook(accexcel, workbook1)
}