Micro Focus QTP (UFT) Forums
End - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: End (/Thread-End)



End - Anna - 08-19-2008

I am using a data table with multiple rows. When the test completes I would like the test to do something at the end. Right now if I put a command at the end of the test it is executed after EACH row and I do not want that. I need some sort of condition so when the test completes the command is excuted.


RE: End - nageshpv - 08-20-2008

Hi Anna,
You can do that by adding the functions you need to execute at the end of the loop.
By the loop, i mean the loop you use to go through the different rows in the datasheet.


RE: End - Anna - 08-20-2008

Hi,
I do not use a loop. I just put stuff in the table and the script runs automatically. Any other ideas?


RE: End - stevol - 08-20-2008

Hi Anna,
you must divide your test in 2 actions, the first with the datatable (setting the action call properties on 'run on all rows'), and in the 2nd action the last commands.


RE: End - Anna - 08-20-2008

I see. I wound up doing this:
Code:
If Datatable.GetCurrentRow =Datatable.GetRowCount then
blah..
end if
This seems to work. However I will try using the actions. I have never used them before so it may be interesting. Thanks,.


RE: End - sreekanth chilam - 08-21-2008

Hi Anna,

Step1; Test-->Settings-->Run-->Select "Run On only one iteration" optionbutton.

Step2: In the Script, get the row count of datatable & store it in a variable as given below :
Code:
rc=datatable.getrowcount
step3: use the for loop here as given below :
          for i=1 to rc
           datatable.SetCurrentRow(i)
            ---------
            ---------
            ---------
            --------
          next

Step4: After the next Statement , you give the required command to be executed & now execute the script n see.......

I hope you got your requirement Solved.

Regards.
Sreekanth Chilam