Micro Focus QTP (UFT) Forums
Iterating, DataTable - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Iterating, DataTable (/Thread-Iterating-DataTable)



Iterating, DataTable - Mukesh.Laxmidhar - 11-11-2010

Hi all,

I am using this code to run the same test through different urls.
Code:
SystemUtil.Run "iexplore",DataTable("FEs",dtLocalSheet)

Q:
Is there I way to have one step or action to be run only in the first iteration.

Thanks in advance.

Regards,
Mukesh L.


RE: Iterating, DataTable - A.Saini - 11-11-2010

Hi Mukesh,

Please be more specific as the relation b/w the URL statement given by you with the question is not very clear.

Smile


RE: Iterating, DataTable - rajeshwar - 11-11-2010

Hi Mukesh,

I think you are looking for feature shown in the screenshot.

Also while calling an action you can provide the number of iteration
Code:
RunAction "MyAction", oneIteration, InputParameter, MyOutPutParameter

Else Code It Smile


RE: Iterating, DataTable - Mukesh.Laxmidhar - 11-12-2010

Hi Ankur,
Ok sorry for not being clear. I am doing regression testing on 4 urls and I have several actions in my test suite. And I use this peace of code in the Driver action:

Code:
' Driver action(Local sheet)  has 4 urls, IE are started 4 times and all actions are performed 4 times
SystemUtil.Run "iexplore",DataTable("FEs",dtLocalSheet)


The Driver sheet in the Datatable has 4 rows with different urls. So because of the code above tests are being iterated 4 times. My dilemma is that I want to perform one step say MsgBox "Hi welcome ...." only in the first iteration. But now any new steps or actions I put in any were are being executed 4 times. I hope this is relevantly clear Big Grin

Btw. why doesn't the <code> tag work Sad

Regards,
Mukesh L.

Hi Rajeshwar,

Yes I have it on "Run on all rows", and that Runaction seems to be the solution to my dilemma. I will try it out and update the result here. Thanks for the help Wink

Regards,
Mukesh L.