Micro Focus QTP (UFT) Forums
comparing two values - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: comparing two values (/Thread-comparing-two-values)



comparing two values - abcdqtp - 11-30-2011

i am trying to compare two values.one which is read from excel and the other captured from the screen(mainframe).the condition is that if those two values are equal we should enter the loop.but condition is not being satisfied where it actually should.the risk on excel is written by the qtp program.please suggest what is going wrong...


RE: comparing two values - ravi.gajul - 11-30-2011

Please post your code?


RE: comparing two values - hamzaz - 04-16-2012

Hi All,

I am comparing two values , If both values are equal test case should pass,

here is what I am doing


Code:
a=datatable("Checked_Text",dtGlobalSheet)
b=datatable("B",dtGlobalSheet)
If strcomp(a,b)=0 then
PASS Testcase
Else

FAIL Testcase

endif

I wonder what I need to do in PASS and FAIL?


RE: comparing two values - saikri - 04-16-2012

Hi ,

You can Put a reporter event with the testcase name and status like
Reporter.ReportEvent Micpass,"TCO1","Pass"

Or you can write it in the datatable itself and export it at the end of the execution