Can anyone let me know whether when creating a Bitmap check the co-ordinates of the image within a window can be ignored.
I have a scenario, whereby an image in a selection window is displayed by the items that match the entry criteria. However, because TP can't capture the text off the screen, mainly due to the widgets etc being painted on, I am using a BitMap Check to determine whether the image is there.
Also, can I not use BitMapSelect without an error message being displayed if the image is not there?
Re: BitMap Checks
There is a workaround for using BitmapSelect as a means of finding a bitmap and still continuing with the script.
First create an error handler and trap the error caused by BitmapSelect, then change the call to BitmapSelect so that you can get its return code, test that and you are done, see the following.
' Create the error handler and tell it what function to execute
Dim oe As TOnError
Set oe = OnError("MyErrorFunction")
' Attach to Program Manager Window
Window("Program Manager Window").Attach
' Try to perform the bitmap select and get the return code.
Dim b As Boolean
b = Window.BitmapSelect("AImageMapEntry")
MsgBox "Return from BitmapSelect = " & CStr(b)
Function MyErrorFunction() As tpOnErrorType
' Error was a caused by the BitmapSelect() method
If Error.Function = "BitmapSelect" Then
' Display an error (if you want)
MsgBox "Message = " & Error.Message & vbCrLf & _
"Function = " & Error.Function & vbCrLf & _
"SourceFile = " & Error.SourceFile & vbCrLf & _
"SourceLine = " & CStr(Error.SourceLine)
' Tell TestPartner that it should execute the next statement
MyErrorFunction = tpResumeNext
' Call the next error handler up the chain
MyErrorFunction = tpNextError
Does that help?