DataTable.GetSheet operation fails

Question ID: 105125

I have a test called CustomerInfo that has multiple reusable actions that we use in other tests.
In my reusable action GetCustomerInfo, I’m using the following code to set which row I want to work with:

DataTable.GetSheet("GetCustomerInfo").SetCurrentRow 2

When I call that action from my main test, it gives me an error saying "The DataTable.GetSheet operation failed. The GetCustomerInfo sheet does not

Marked as spam
Posted by (Questions: 339, Answers: 20)
Asked on September 30, 2013 8:34 pm
Answers (1)
Private answer

This happens because when the reusable action is called, the local datasheet gets renamed when called from another test, in your case to CustomerInfo [GetCustomerInfo]. To fix this, change it to where you are using dtLocalSheet rather than the action's name, so:

DataTable.GetSheet(dtLocalSheet).SetCurrentRow 2

dtLocalSheet will always be the local sheet of whatever action it is used in, so when you call GetCustomerInfo from your main test and then use dtLocalSheet, it will use the sheet for GetCustomerInfo.

You can also use the following code within GetCustomerInfo to do the same thing:

Datatable.LocalSheet.SetCurrentRow 2

Marked as spam
Posted by (Questions: 16, Answers: 749)
Answered on September 30, 2013 8:34 pm
That worked great! Thanks!
( at September 30, 2013 8:35 pm)