Micro Focus QTP (UFT) Forums
Pass Fail on an If-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: Pass Fail on an If-Statement (/Thread-Pass-Fail-on-an-If-Statement)



Pass Fail on an If-Statement - AGrant - 08-27-2008

Is there a way in QTP to use an if-statement and if the if-statement is true have a command to tell the script to pass if it is false have a command to tell the script to fail. The closest I could come up with was to use a message box? Thanks for the Help

Code:
If (QT = RXDaysSupply) THEN

MSGBOX "The Days Supply is Correctly Calculated at  " & RXDaysSupply

Else

MSGBOX "The Days Supply is Wrong at "  & RXDaysSupply

End If



RE: Pass Fail on an If-Statement - somisays - 08-27-2008

Hi,
You can use the Reporter.ReportEvent for this.
Please read the following article by using the below link..

https://www.learnqtp.com/qtp-and-reporter-objects/


RE: Pass Fail on an If-Statement - AGrant - 08-27-2008

Thanks for the help. That worked great.


RE: Pass Fail on an If-Statement - kishoreinchennai - 08-28-2008

Print Command

Print "Pass"


Regards
Kishore