Forum Discussion

rushikesh's avatar
rushikesh
Contributor
8 years ago

Can i modify checkpoint message which appears in log when a checkpoint is passed or fail ?

Can i modify checkpoint message which appears in log when a checkpoint is passed or fail ?

 

I have a object checkpoint say "Test"

when this object checkpoint is passed I get message in log as "The object checkpoint "Test" passed".

My requirement is to modify this message, so that I can specify what is that object "Test" in detail.

Say something like this when Object checkpoint test is passed.

"The checkpoint for number of files passed"

 

or 

 

"The checkpoint for number of files failed" when checkpoint fails.

 

I can do this by using if statement

 

if(object.Test)

log.checkpoint("The checkpoint for number of files passed")

 

 

Problem with above code is that it will give me two messages in log.

 

The object checkpoint "Test" passed.

The checkpoint for number of files passed.

 

I don't want the first message, as person reading the log file wont understand it.

 

Is there any way to do it ?

 

2 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

    One way is get rid of Object check point and do only with Log.checkpoint("blabla"+VariableFileNo)

    Here is link to documentations

    I do not use object checkpoint rather use...something like

    If (X=Y)
     Log.Checkpoint("My message")
    Else
      Log.Error("My Error Message")

     

     

     

     

     

     

     

     

     

     

     

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    You may consider aqObject.CompareProperty method (with the last parameter set to BuiltIn.lmNone to prevent logging) that returns boolean.

    Verification point in this case might be like this (VBScript pseudocode):

    If (aqObject.CompareProperty(, , , , BuiltIn.lmNone)) Then

      Call Log.Checkpoint(<some message>, , , , obj.Picture)

    Else

      Call Log.Error()

    End If