Micro Focus QTP (UFT) Forums
Help with Loop - 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: Help with Loop (/Thread-Help-with-Loop)



Help with Loop - LJENNE - 08-10-2012

Looking to build a loop into my script.

The actions in the script are as follows

Search variable x
update fields xyz on variable profile
Return to search
Repeat

Any suggestions?


RE: Help with Loop - Ankesh - 08-10-2012

There should be some exit criteria/No. of times when you want to stop repeating. Please post the exit condition.

I am posting a sample code...
Code:
Do
'Search variable x
if x.Exist then
'Set the value for x
Else
'x not found
End IF
While <Your exit condition>
You can use any loop to achieve your objective. Do let me know if you need more help.

Regards,
Ankesh