Forum Discussion

MonicaTeotia's avatar
MonicaTeotia
Occasional Contributor
2 years ago

Reading data from excel

 

Hi,

I want to read data from a different cell each time my script runs.

I have created a variable and set its mode as LastOperationResult however it is reading the data from the same cell specified in the cell fields while creating the readexcel variable.

How can we achieve this?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Are you using keyword test? Are you referring to data driven testing? How are you reading the first cell?

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    You should put the variable under persistent project variables, if you +1 that one it saves it for next time.

    That variable is your row counter, then just select cells by using ""A "+ Project.Variables.Row" & ""B "+ Project.Variables.Row" etc.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    if you're reading the rows one by one you could also do someting like this:

    It sets the variables to value by parameterized excelfile, sheetname, cell name: Cell A +rowcounter

    Its in VBScript so might not work exactly like this for you.