jyothi_priya
13 years agoContributor
How to post object name in log messages
Hi,
I have written a script as follows:
Function clickcontrol(Object)
If Object.exists then
Object.Click
Else
Log.Message( Object & " is not found") 'This is actually not working when object does not exist
End If
End function
Sub abc()
XXX = NameMapping.Sys.Process("XXX")
Call clickcontrol(XXX)
End Sub
My Req is:
If object XXX does not exist, then I should get a log message 'XXX is not found'. Using Log.Message( Object & " is not found") throws error as object itself doesnot exist. Is there any way to display object custom name when it doesn't exist?
I have written a script as follows:
Function clickcontrol(Object)
If Object.exists then
Object.Click
Else
Log.Message( Object & " is not found") 'This is actually not working when object does not exist
End If
End function
Sub abc()
XXX = NameMapping.Sys.Process("XXX")
Call clickcontrol(XXX)
End Sub
My Req is:
If object XXX does not exist, then I should get a log message 'XXX is not found'. Using Log.Message( Object & " is not found") throws error as object itself doesnot exist. Is there any way to display object custom name when it doesn't exist?