I am using the below code to set the Property Values from Excel file to my Property Step and then pass it to the testcase.
When I run the Groovy code, the value from the last cell of the excel comes to the property step.
Please help me out to set the properties correctly.
What I have tried:
import jxl.*
Workbook wb = Workbook.getWorkbook(new File("C:\\Users\\naraysa1\\Desktop\\Address_Doctor\\DataSource_Address_Validate\\Data_AddressValidate.xls"))
Sheet sh = wb.getSheet(0)
RowCount = sh.getRows();
ColumnCount = sh.getColumns();
for (i=1;i<RowCount;i++)
{
for (j=0;j<ColumnCount;j++)
{
def c = sh.getCell(j, i).getContents();
log.info c
testRunner.testCase.getTestStepByName("Properties_Address").setPropertyValue("ID", c)
testRunner.testCase.getTestStepByName("Properties_Address").setPropertyValue("AddressLine1", c)
testRunner.testCase.getTestStepByName("Properties_Address").setPropertyValue("AddressLine2", c)
testRunner.testCase.getTestStepByName("Properties_Address").setPropertyValue("AddressLine3", c)
testRunner.testCase.getTestStepByName("Properties_Address").setPropertyValue("City", c)
testRunner.testCase.getTestStepByName("Properties_Address").setPropertyValue("State ", c)
testRunner.testCase.getTestStepByName("Properties_Address").setPropertyValue("PostalCode", c)
testRunner.testCase.getTestStepByName("Properties_Address").setPropertyValue("Country", c)
def TestStep = testRunner.runTestStepByName("Search_Address")
}
}