Workbench:VerifyAsset works only for True?
Executes a verification asset. Throws an ObjectNotFoundException if the UI object to verify cannot be found.
result = Verification.VerifyAsset(verificationAsset)
Is there some possible usage of this method or another method that could stop the script and display a desired message in the error window?
This seems to be useful only for the True case as for the false the playback crashes with an error popup, not being able to use the False boolean in any way.
You can use a Try Catch statement and using MessageBox display a dialog which would stop the script until action is taken:
Dim result As Boolean
result = Workbench.VerifyAsset("GMO Logo")
MsgBox("Image Verification Passed")
MsgBox("Image Verification Failed")
If (result = True)
You will also need to go into Options > Playback > General > Set "Catch Exceptions when thrown" to NO. The above example will perform a Try Catch to verify the asset on screen. If not found it will be caught in catch statement and MsgBox stating it wasn't found will display. Otherwise, if found, result = true, it will display msgbox stating it was found, and after try catch ends, it will use the result value to determine how to proceed.
UFT | UFT Mobile | Silk Test