0

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!

3
  • How many times Action1 gets called? Commented Jul 13, 2017 at 9:03
  • Also, have you used error handling? If you have used statements like 'On Error Resume Next' or 'Proceed to Next Step' in QTP settings, please disable them to show any error. Commented Jul 13, 2017 at 9:07
  • Do you intend to store the output of Action1 in the variable "thing"? Commented Jul 13, 2017 at 13:49

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.