Hi tell me the code to stop an iteration in between the run in QTP?
NOTE : [This question was asked by rameshkumars]
Hi tell me the code to stop an iteration in between the run in QTP?
NOTE : [This question was asked by rameshkumars]
Change the value of the loop counter when the condition satifies to stop an iteration.
Eg:
for i=0 to 10 step 1
if (condition) then
i=(10 to exit the for loop/ i+1 to stop current iteration continue)
end if----
----
--- other loop statements....
next
OR
ExitTest as far as I know will exit the test.
But, what we are talking about here is to exit the iteration and not the whole test.
Last edited by jainbrijesh; 05-22-2007 at 08:47 AM.
Lack of WILL POWER has caused more failure than
lack of INTELLIGENCE or ABILITY.
-sutnarcha-
you may just use "exitglobaliteration" once a condition is met.
Use exitIteration where ever the conditionis met
please give the example how to use?
ExitTest is enough
OR
Int_value = 20
If (Int_value < 0)
print "Positive number" & Int_value
Else
print "Negative number" & Int_value
ExitTest
EndIf
print "Exittest is not executed"
Last edited by jainbrijesh; 05-22-2007 at 09:19 AM.
use ExitActionIteration("return value")
Yes by making use of ExitActionIteration("return value") which has the return value generated in the decission making conditional loop. We can exit the iteration.
Ifthen
ExitActionIteration("return value")
Endif
Arun*