Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass Fail on an If-Statement
#1
Solved: 11 Years, 4 Months ago
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
Reply
#2
Solved: 11 Years, 4 Months ago
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/
Reply
#3
Solved: 11 Years, 4 Months ago
Thanks for the help. That worked great.
Reply
#4
Solved: 11 Years, 4 Months ago
Print Command

Print "Pass"


Regards
Kishore
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  To send Fail Results to mail Naresh 1 2,532 04-23-2015, 08:30 PM
Last Post: babu123
  PASS/FAIL in QTP badri 3 6,197 12-05-2014, 03:26 AM
Last Post: kiranpol
  Fail when running multiple actions in QC crissbbbm 0 2,608 08-29-2013, 07:52 PM
Last Post: crissbbbm
  how to pass the data frm datatable silpavinod 3 3,950 10-18-2012, 01:54 PM
Last Post: silpavinod
  how to pass a numeric value into webedit silpavinod 3 3,863 10-15-2012, 01:57 PM
Last Post: silpavinod

Forum Jump:


Users browsing this thread: 2 Guest(s)