Ask a Question

Reading data from excel

MonicaTeotia
Occasional Contributor

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?

4 REPLIES 4
MW_Didata
Regular Contributor

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

MW_Didata_0-1695991116236.png

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

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
Regular Contributor

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

MW_Didata_0-1695991690560.png

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.

Marsha_R
Champion Level 3

Here's a built-in function that will help. There are examples for Keyword Tests and Scripts.

https://support.smartbear.com/testcomplete/docs/testing-with/working-with-external-data-sources/exce...

cancel
Showing results for 
Search instead for 
Did you mean: