Micro Focus QTP (UFT) Forums
How to set Test case status? - 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: How to set Test case status? (/Thread-How-to-set-Test-case-status)



How to set Test case status? - hamzaz - 04-16-2012

Hi All,

I am going through a test case in which I need to compare two values,
following is my code.
Code:
a=datatable("Checked_Text",dtGlobalSheet)
b=datatable("B",dtGlobalSheet)
If strcomp(a,b)=0 then
PASS Testcase
Else

FAIL Testcase

endif

I wonder how to do it? Like the PASS and FAIL ?


RE: How to set Test case status? - sshukla12 - 04-16-2012

Hi,Use reporter. report event , it will help u out.

Regards,
Sankalp


RE: How to set Test case status? - avinash_learnqtp - 04-17-2012

Code:
If strcomp(a,b)=0 then
reporter.reportevent micpass, "stepname", "comparison pass"
Else
reporter.reportevent micfail, "stepname", "comparison fail"
end if



RE: How to set Test case status? - Shrikant Deyannavar - 05-02-2012

Hi Sankalp,
i suggest u to use instr function instead of "if" and u cant find ur ans with instr function. thin klittle logically(if u r 3 years exp ,u will get my point). let me know if any concerns

Thanks u
Shrikant Deyannavar


RE: How to set Test case status? - sshukla12 - 05-04-2012

Hi Shrikant Deyannavar,

Kindly go through the post correctly before giving any comments, I had not suggested to use "if" , it was 'avinash_learnqtp' who proposed this solution , I suggested to use report.report event, So it will be very nice and gentle of u if u read correctly first and then give ur usefull comments to the concerned person, as an IT professional these are the basic which u should know. Cool
Regards,
Sankalp