Thursday, August 28, 2008

Pass Fail on an If-Statement

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

If (QT = RXDaysSupply) THEN

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

Else

MSGBOX "The Days Supply is Wrong at " & RXDaysSupply

End If

1 comment:

Arvy said...

If (QT = RXDaysSupply) THEN

Reporter.ReportEvent micPass,"Supply Passed","The Days Supply is Correctly Calculated at " & RXDaysSupply


Else

Reporter.ReportEvent micFail,"Supply Passed","The Days Supply is wrong at " & RXDaysSupply

End If

Admin, QTP Tutorials