Hi tell me the code to stop an iteration in between the run in QTP?
NOTE : [I][This question was asked by rameshkumars][/I]
Printable View
Hi tell me the code to stop an iteration in between the run in QTP?
NOTE : [I][This question was asked by rameshkumars][/I]
Change the value of the loop counter when the condition satifies to stop an iteration.:D
Eg:
for i=0 to 10 step 1
[COLOR="Red"]if (condition) then
i=(10 to exit the for loop/ i+1 to stop current iteration continue)
end if[/COLOR]----
----
--- other loop statements....
next
:cool:
OR
[B]ExitTest as far as I know will exit the test.:eek:
But, what we are talking about here is to exit the iteration and not the whole test.[/B]:D
you may just use "exitglobaliteration" once a condition is met.
Use [B]exitIteration[/B] where ever the conditionis met
please give the example how to use?
ExitTest is enough
[B]OR[/B]
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"
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.
If <check for condition> then
ExitActionIteration("return value")
Endif
Arun*