Sarah H.
Sarah H.

Reputation: 601

While loop in QTP

I'm trying to execute the while loop in QTP below

x = true
y = 2 
Do While x = True
Msgbox y
thing = RunAction "Action1",oneIteration, y
x = thing
y = y + 1
Loop

When I don't call the RunAction it will call "msgbox y" as it should, but when I include it the first Msgbox just does does not get called at all. It doesn't even display an empty msgbox. Action 1 ends up being called with its default number instead of y. Help!

Upvotes: 0

Views: 947

Answers (1)

vins
vins

Reputation: 15370

Press ctrl + F7 to see any syntax error in QTP. If you return a value, you should use () for the functions.

Retry as shown here and share what you find.

Do While x = True
  Msgbox y
  x= RunAction("Action1",oneIteration, y)
  y = y + 1
Loop

Upvotes: 1

Related Questions