Output a custom variable to the datasheet?
Please excuse me if this is a common topic, I couldn't find any reference to it.
On my application-under-test, you can add multiple items to the work object. I want to set a timer so that I can see how long it takes to add each item (I already figured this part out with the help of this forum) and now I want to collect all of the timers into a single spreadsheet.
I've been looking for about 90 minutes now and I can't seem to find any way to do it.
The way I've been capturing the data is by using this kind of syntax:
CaptureTimeStart = timer
(do my business)
CaptureTimeEnd = timer
CaptureTime = CaptureTimeEnd - CaptureTimeStart
This works great as long as all I want to do is capture one variable and then display it in a msgbox. But I would like to run this many times (several hundred times) in one test run and write the timer for each iteration of the loop into its own cell in a spreadsheet. Is this possible?
My first instinct was to just write to a text file and then paste it into Excel. However, my vbscript is rustier than I thought and I'm having a lot of trouble writing to a text file from QTP.
Another possibility is to just output it to the data table... but I can't seem to find any options for outputting custom variables to the data tables. Any ideas?
Re: Output a custom variable to the datasheet?
Read QTP online help for DataTable Object, that will tell you how to read and write values into dataTable during script execution.