Forum Discussion

steve_hall's avatar
steve_hall
Contributor
12 years ago

QTP "reporter.reportevent micpass / micfail" in TC?

Hi All,



I'm from a QTP background, and in a QTP script I could write something like:



if (a=b) then

  reporter.reportevent micpass, "a equals b, yippee"

else

  reporter.reportevent micfail, "a is different to b. this is not good"

endif



However, if I'm understanding correctly, in TC (jscript) this becomes:



if (a=b)

{

  log.checkpoint ("a equals b, yippee");

}

else

{

  log.error ("a is different to b. this is not good");

}

endif





I appreciate this isn't a HUGE difference, but I just want to check:

a) is there something "closer" to QTPs micpass/micfail (arguably more "readable")

b) is my understanding above correct?





Thanks



Steve
  • gid_216's avatar
    gid_216
    Frequent Contributor
    Hi Steave,.



    For micPass, in TC log.message and for micfail, log.error is being used. log.checkpoints are automatically inserteted to log if any checkpoint is executed.



    log.message will not provide the icon similar to that of micPass but log.error will provide the same red colored cross icon as of micFail.



    @All : Correct me if there is any change in my understanding.
  • Hi Deepak,



    Thanks for that... 



    It seems using Log.Checkpoint is the way forward to get a "green tick" ... I guess it's a sort of "psychology" thing of QTP vs TC .... I'm very much familiar with micPass/micFail... and just need to get used to checkpoint/error instead ;)



    Thanks



    Steve