Micro Focus QTP (UFT) Forums

Full Version: How To Stop Execution
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All ,

I need to stop my execution as soon as conditions is fullfilled. Tried this way:

Code:
If Condition = True then
  Msgbox "Execution will stop after this."
  Exit Run
End if

but whenever I write down Exit Run or even Exit Test there comes a syntax error saying invalid Exit statement. I tried to put this code in all the function files of my framework and even in actions but the result is same.

Can anyone help me out in this?
Use ExitTest instead of Exit Run.
You can use ExitAction also...if you want come back from particular Action Only...
-----------------------OR----------

ExitTestIteration if you want exit from current iteration and move to next iteration...

Hope this will help you....Smile


Looks like you are using space betweek 'Exit' and 'Test'. You should not use any space between them.

ExitTest can be used for this purpose.