Forum Discussion
AlexanderM
Staff
16 years agoHi,
To Muhammad:
You should avoid using Log.Message inside the OnLogMessage event handler to avoid recursive calls. The event handler should look like this:
Sub GeneralEvents_OnLogMessage(Sender, LogParams)
messageString = "The property value ""True"" equals the baseline value ""True""."
If LogParams.Str = messageString Then
LogParams.Str = "My Custom Message"
End If
End Sub
To Amarajothi:
As an alternative, to post a custom message to the log when a checkpoint passes or fails, you can follow the steps below:
1. Suppress the log.
2. Perform a checkpoint and save its result to a variable.
3. Enable the log.
4. Post a custom message.
Here is an example:
Log.Enabled = False
Result = aqObject.CompareProperty(Aliases.Printgroove_POD_Ready.HwndSource_CPGRMainWnd.CPGRMainWnd.grManinWindowGrid.dpPageAreaPanel.dockManager.Grid.Grid.gridDocking.zpanel.Grid1.Grid.DockablePane.DockPanel.PaneHeader.DockPanel.tbTitle.VisibleOnScreen, cmpEqual, True, False)
Log.Enabled = True
If Result Then
Log.Message("Page button is visible")
Else
Log.Warning("Page button is not visible")
End If
Please see the aqObject.CompareProperty help topic for more information.
BTW, the latest TestComplete version is 8.10.