Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
My suggestion would be to use an ODT.Data.Group Variable of type Array. Then, when you run through your tests, "scrape" the number from the component on the page and stored it in an item in the array.
When you go to close your application, you should then be able to iterate through your array, reading out the values, and then, once you're all done with all the values, dispose of the array.
So, first pre-requisite would be to have the ODT object in your project. Easy enough to add (right click on the project in the project explorer, click Add, and select New Item and then select the ODT object from the list.
Now... while you're going to be using keyword tests for most of your stuff, I'd suggest doing the actual storage using piece of script code that you would just call in your keyword test.
Application numbers can then be retireved based upon the array, like ODT.Data.Globals.ApplicationVariable.Items[0] for the first item, [1] for the second, and so on.
You can then remove the variable at the end so it's cleared out for the next run.
When you go to close your application, you should then be able to iterate through your array, reading out the values, and then, once you're all done with all the values, dispose of the array.
So, first pre-requisite would be to have the ODT object in your project. Easy enough to add (right click on the project in the project explorer, click Add, and select New Item and then select the ODT object from the list.
Now... while you're going to be using keyword tests for most of your stuff, I'd suggest doing the actual storage using piece of script code that you would just call in your keyword test.
//JavaScript
function AddApplicationToArray(ApplicationNumber)
{
var DataGroup = ODT.Data.Groups('Globals')
if (DataGroup == null)
{
DataGroup = ODT.Data.AddGroup('Globals')
}
var ApplicationVariable = DataGroup.Variables('ApplicationArray')
if (ApplicationVariable == null)
{
ApplicationVariable = DataGroup.AddVarOfArrayType('ApplicationArray')
}
ApplicationVariable.AddItem(ApplicationNumber)
}
Application numbers can then be retireved based upon the array, like ODT.Data.Globals.ApplicationVariable.Items[0] for the first item, [1] for the second, and so on.
You can then remove the variable at the end so it's cleared out for the next run.