I have a script with 3 actions (and 2 records in the Global Datatable.)
1 and 2 are login screens.
3 enters details - I have a while loop here which enters all details from both records in the datatable but then runs through the second DT record and when in action 3 both records are run again.
The question I have is 'how do I log on, enter details more than once, log off and then repeat the process(but moving to record 2 of the DT?)
Hope this makes sense - I can post the code if needed [img]images/icons/frown.gif[/img]
Just before the end of the While loop I increment the counter and then use the Data Table.SetNextRow method. Do I need to use an array for the fields in the while loop?
Thanks in advance [img]images/icons/smile.gif[/img]
In the settings I had set the 'run on all rows' (although this seems to set all actions?) and It still ran as I stated.
I re-entered the while loop with the setnext row, and the script ran correctly:-o
My thinking is that I got 'lucky' and would be more happy if the solution made sense.:-)
Thanks for your help Mo T (and Mark yet again) - It's much appreciated :-)
As Motest said you need to set the Run one iteration only in Test > Settings > Run, then go to the Keyword View, right-click on Action3, select Action Call Properties and set it to run on all rows (this should not affect the Settings > Run one itertation only) for the global iteration.
Not sure if you know but to use data from a local datasheet you need to add dtLocalSheet to the method, e.g.
Blades you seem to be hell-bent on manipulating the datasheet yourself (SetNextRow etc.) I would advise you at this stage of your learning that you let QTP handle the sheet manipulation (which it quite easily does) as this is a fundamental concept which all QTP people need to be very comfortable with.
When you move on to reuseable actions without this knowledge you may get well and truely confused.