How to see variable values in UFT?
Question ID: 105683
1
0

My script is not giving me the results I expect, and I need to confirm the values of some of my variables during execution of the script. How do I check and see what the values are during script execution?

Marked as spam
Posted by (Questions: 386, Answers: 64)
Asked on October 29, 2014 9:11 pm
508 views
Answers (1)
1
Private answer

There are a few ways you can check variable values during a script. You'll need to either put a breakpoint in the script in a location after the variable value has been assigned, or pause the script after the variable value has been assigned.

Once the script stops, you can highlight the variable and either right click it and click ''Add to Watch'' or you can just hit CTRL-T to add it to the Watch list. You can then view the variable in the Watch tab (to get this tab in view, go to View>Debug>Watch).

You can also look at the Local Variables tab (to get this tab in view, go to View>Debug>Local Variables) to see what variables are currently in scope and what their values are, as well as their data type.

Another way would be to add msgbox code to your script to display variable values in a message box. I would recommend using the above 2 methods over the msgbox method.

Marked as spam
Posted by (Questions: 16, Answers: 807)
Answered on October 29, 2014 9:11 pm
0
I had forgotten about the Watch list cause it was not active on my UFT! I did not know about the Local Variables tab, that is nice to know.
( at October 29, 2014 9:12 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top