Morgan
14 years agoFrequent Contributor
Event Handlers
Hello,
1) I am working on a handler for OnLogError that stops script execution after a certain number of errors. It doesn't appear to be working, though. So far, I have this :
Err.Clear
On Error Resume Next
If Err.Number > 3 Then
Log.Message "Max number of errors reached - Test execution halted"
Runner.Stop
End If
Any ideas?
2) Secondly, I was wondering if it was possible to create a script that (on region checkpoint error) attains the actual region image used, assigns it a name of your choosing and puts it in a folder along with the diff file and expected image. I'm not sure if this is possible with a handler...? The actual images saved to the TC directory are hard to sort through and match up. Basically for the project I am working on, we'd like to attain the expected, actual, and dif .pngs so we can manually look through the differences.
I was working on the following but it's not working and not correct (how do I add the dif file?) :
Thanks!
Morgan
1) I am working on a handler for OnLogError that stops script execution after a certain number of errors. It doesn't appear to be working, though. So far, I have this :
Err.Clear
On Error Resume Next
If Err.Number > 3 Then
Log.Message "Max number of errors reached - Test execution halted"
Runner.Stop
End If
Any ideas?
2) Secondly, I was wondering if it was possible to create a script that (on region checkpoint error) attains the actual region image used, assigns it a name of your choosing and puts it in a folder along with the diff file and expected image. I'm not sure if this is possible with a handler...? The actual images saved to the TC directory are hard to sort through and match up. Basically for the project I am working on, we'd like to attain the expected, actual, and dif .pngs so we can manually look through the differences.
I was working on the following but it's not working and not correct (how do I add the dif file?) :
Set Pict = Sys.Desktop.PictureUnderMouse(20, 20, False) ' But I'd much rather attain the actual image file...
Set StoredPict = Regions.GetPicture("StoredImageName")
If Regions.Compare(StoredPict, Pict, False) then
Call Pict.SaveToFile("C:\Folder\Results\Compares\"+StoredImageName+ACTUAL.png)
Call StoredPict.SaveToFile("C:\Folder\Results\Compares\"+StoredImageName)
Call Log.Message("Compare Files Saved to C:\Folder\Results\Compares")
End If
Thanks!
Morgan