Forum Discussion

ar2015's avatar
ar2015
New Contributor
10 years ago

Excel Datasource only returns last value when accessed via Groovy

Hi,

 

Ready API 1.4.1.  I am trying to fetch a particular row from Datasrouce-Excel via Groovy. But it always returns the last row in the excel.

I tried addding Start Row and End Row cell numbers in the Datasource also. It still does NOT help.

 

Excel Datasource is populated with 3 rows with mobileNumbers. When I click on play button on the datasource all the values in 3 rows are returned.  But when I acceess this in Groovy, it only returns the last row.

 

Mobile nos in 3 rows are 9991111234 and 9991111235, 9991111236

def Dtsrc=testRunner.testCase.getTestStepByName("Master-Excel")
def mob= Dtsrc.getProperty("MobileNumber")

 

This only returns the last value 9991111236

 

 

 

  • Never mind! Found out the way to do by the row number field.

    Thank you!

  • ar2015's avatar
    ar2015
    New Contributor

    Never mind! Found out the way to do by the row number field.

    Thank you!