Micro Focus QTP (UFT) Forums

Full Version: CheckPoints: Are they only for objects?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to know if one could create a Checkpoint for a variable? For example, in my application I have a textbox that displays value x. I need to confirm that this value has followed through to another form and textbox in the application. My initial thought would be to create a variable for the first textbox and a variable for the second textbox and compare the two (The text for example, might not even be exactly the same, I might need to verify that a portion of the first textbox text has reached the second textbox). I would like to make it so the Test Results Form of QTP would show a PASS or a FAIL, depending on the verification. Is this possible?

Thnx, Howard
You can use a conditional statement to verify.
And to report to Results use Reporter Object.
Thank you. Yes, I figured I would use an "If/Then" statement to prove the Pass/Fail. But I did not know about the Reporter. I will research that now.

Thnx again!
You can check in QTP Help.
Hi,

Please try out the below code which may useful to you.
Code:
Browser("Browser").Page("Gmail: Email from Google").WebEdit("Email").Set "xyz"
Browser("Browser").Page("Gmail: Email from Google").WebEdit("Passwd").Set "xyz"
temp1=Browser("Browser").Page("Gmail: Email from Google").WebEdit("Email").GetROProperty("value")
temp2=Browser("Browser").Page("Gmail: Email from Google").WebEdit("Passwd").GetROProperty("value")

If temp1=temp2 Then
    reporter.ReportEvent micPass,"Check status","Values in the text box are matched"
else
    reporter.ReportEvent micFail,"Check status","Values in the text box are not matched"
End If
Thanks & Regards,
Uday.
thnx, perfect!