Micro Focus QTP (UFT) Forums

Full Version: How to set Test case status?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 ?
Hi,Use reporter. report event , it will help u out.

Regards,
Sankalp
Code:
If strcomp(a,b)=0 then
reporter.reportevent micpass, "stepname", "comparison pass"
Else
reporter.reportevent micfail, "stepname", "comparison fail"
end if
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
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