Adding Data to Local Sheet

Question ID: 104234

I am having a bit of an issue adding data to local sheet on my test. I am using the code

datatable("A","Compare results")= currentlocation

This is adding Currentlocation to my datatable named Compare results BUT when i run more then 1 iteration of the test it writes over each entry so that after running 5 iterations all i get is 1 entry.

is there a way i can keep building information into the local sheet so that i can export it out at the very end?

Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on September 29, 2010 5:18 pm
Answers (2)
Private answer

Does the datatable sheet contain at least one value for each row you are trying to put a value into? QuickTest Professional will allow setting a value in a row (on a sheet) only if the row already contains at least one value.

Recommend putting the data into the global sheet or creating sample data values for each row in the local sheet you would like to update.

I do not know what you are trying to do but here are couple ideas to capture data.

  1. Export the global sheet and import it into system as local to capture data. This way you can update the local sheet.
  2. Just send data to Excel spreadsheet instead of local sheet.
Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on October 1, 2010 6:52 pm
Private answer

I would get the Current row that the global table is on and use that to set the row that the local table is to be written to. the code will look something like this.

GRow = DataTable.Getsheet(dtGlobalSheet).GetCurrentRow
DataTable.GetSheet(''Compare results'').setCurrentRow GRow
datatable.Value(''A'',''Compare results'') = currentlocation

Hope This Helps

Marked as spam
Posted by (Questions: 1, Answers: 69)
Answered on November 3, 2010 4:21 pm