Micro Focus QTP (UFT) Forums
Can we use checkpoint as a condition statement? - 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: Can we use checkpoint as a condition statement? (/Thread-Can-we-use-checkpoint-as-a-condition-statement)



Can we use checkpoint as a condition statement? - riteshgpt - 04-22-2010

CheckPoint

Code:
If Window("OW(Version").WinObject("#32770").Check CheckPoint("ReadyState-Verification") =true then

end if

I am looking some thing like that...
Any suggestion how to make checkpoint as conditional statement ?

Thanks for any suggestion.


RE: Can we use checkpoint as a condition statement? - manishbhalshankar - 04-23-2010

Hi Ritesh,
Save the value of checkpoint in a variable. As the value is boolean you can use the variable itself as condition:
Code:
dim chkpointstatus
chkpointstatus = Window("OW(Version").WinObject("#32770").Check CheckPoint("ReadyState-Verification")
If chkpointstatus then
    <something>
Else
    <something else>
end if



RE: Can we use checkpoint as a condition statement? - riteshgpt - 04-23-2010

Hi manish,

thanks for help.
however I am getting error on below statement "Expected End of Statement"
Code:
chkpointstatus = Window("OW(Version").WinObject("#32770").Check CheckPoint("ReadyState-Verification")
Is that same way to store Checkpoint result or any otherway ?
Thanks in Advance


RE: Can we use checkpoint as a condition statement? - manishbhalshankar - 04-23-2010

Hi Ritesh,
Try:
Code:
chkpointstatus = Window("OWVersion").WinObject("#32770").Check (CheckPoint("ReadyState-Verification"))



RE: Can we use checkpoint as a condition statement? - riteshgpt - 04-28-2010

Thanks Manish. Its done.