Micro Focus QTP (UFT) Forums
Reporter.reportevent result not displayed for second checkpoint - 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: Reporter.reportevent result not displayed for second checkpoint (/Thread-Reporter-reportevent-result-not-displayed-for-second-checkpoint)



Reporter.reportevent result not displayed for second checkpoint - sudhirzpatil - 11-27-2010

Hi All,

I am facing one issue in which Reporter.reportevent..... test result not displayed for second checkpoint.

In mercury web site I am validating the Default date and month with current month and date.
I used following If Else statement...

Code:
If c=f Then
Reporter.ReportEvent 0,"Curent Month verified","Valid Month...Test Passed"
End If
If d=h Then
Reporter.ReportEvent 0,"Curent date verified","Validdate...Test Passed"
End If

My both conditions satisfied, but only first Test result displayed.
Second result "Curent date verified","Validdate...Test Passed" not displayed in Test Result even though d=h satisfied.

Any one pls help me why it is not displaying ?


RE: Reporter.reportevent result not displayed for second checkpoint - manishbhalshankar - 11-30-2010

Hi Sudhirzpatil,

Add Else condition and check if you get a fail result.


RE: Reporter.reportevent result not displayed for second checkpoint - sudhirzpatil - 12-05-2010

Code:
a= captured value from script
b= captured value from script
m=MonthName(month(date))
n=Day(date)
If a=m Then
msgbox "Current month match"
else
msgbox "Current month not match"
End If
If b=n Then
msgbox "Current Date match"
else
msgbox "Current Date not a match"
End If

Here a=m and b=n both condition satisfy, still it display "Current Date not a match" for second condition.


RE: Reporter.reportevent result not displayed for second checkpoint - manishbhalshankar - 12-06-2010

Hi Sudhir,

Please mention the values in a, b, m and n.
Try using CDate(a) and CDate(b) at the time of verification.


RE: Reporter.reportevent result not displayed for second checkpoint - sudhirzpatil - 12-06-2010

Hi Manish,
Captured value for a= December ( Vurrent month)
Captured value for b= 6 (i.e Todays Date)

My result shows "Current month match" which is true.
but even if b=n satisfied, it displayed "Current Date not a match"
Is there anything wrong with If..else statment ?


RE: Reporter.reportevent result not displayed for second checkpoint - manishbhalshankar - 12-07-2010

Try,

CInt(b) & CInt(n)

This will convert the value in b and n to int and then check if both values are same.
This should work.