Micro Focus QTP (UFT) Forums
CheckPoints: Are they only for objects? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: CheckPoints: Are they only for objects? (/Thread-CheckPoints-Are-they-only-for-objects)



CheckPoints: Are they only for objects? - Hbomb624 - 07-16-2008

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


RE: CheckPoints: Are they only for objects? - niranjan - 07-16-2008

You can use a conditional statement to verify.
And to report to Results use Reporter Object.


RE: CheckPoints: Are they only for objects? - Hbomb624 - 07-16-2008

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!


RE: CheckPoints: Are they only for objects? - niranjan - 07-17-2008

You can check in QTP Help.


RE: CheckPoints: Are they only for objects? - anemuday - 07-17-2008

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.


RE: CheckPoints: Are they only for objects? - Hbomb624 - 07-17-2008

thnx, perfect!