Micro Focus QTP (UFT) Forums

Full Version: Pass Fail on an If-Statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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/
Thanks for the help. That worked great.
Print Command

Print "Pass"


Regards
Kishore