Action at point beyond the the screen problem
I'm having a problem with a GUI test. Basically I have loaded my application, and having TC do mouse actions at random points within the area of the application. From time to time I get an error in my log that says "There was an attempt to perform an action at a point, which is beyond the screen".
Problem is, that I don't believe it is beyond the screen... First my code for clicking the application:
(L_ObjAUT is a reference to the mainform of my application)
L_intWndHeight = StrToInt(L_objAUT.Height - 1)
Log.Event("L_intWndHeight: " & L_intWndHeight)
L_intWndWidth = StrToInt(L_objAUT.Width)
Log.Event("L_intWndWidth:" & L_intWndWidth - 1)
Randomize()
Dim L_RandomNo
L_RandomNo = Rnd()
Log.Event("Random No Y: " & L_RandomNo)
L_intYcoor = Int(L_intWndHeight * L_RandomNo)
Log.Event("L_intYcoor: " & L_intYcoor)
L_RandomNo = Rnd()
Log.Event("Random No X: " & L_RandomNo)
L_intXcoor = Int(L_intWndWidth * L_RandomNo)
Log.Event("L_intXcoor: " & L_intXcoor)
L_strMouseAction = MonkeyMouseInput() ' Finds mouse action (click, dblclick, leftclick and so on)
L_strMouseModifer = MonkeyMouseModifier() ' Finds modifier (Shift key, ctrl and so on)
L_strCommand = "L_objAUT." & L_strMouseAction & "(" & L_intXcoor & "," & L_intYcoor & "," & L_strMouseModifer & ")"
Log.Event(L_strCommand)
Execute("Call " & L_strCommand)
BUT, in my logfile I get the following:
L_intWndHeight: 775
L_intWndWidth:1031
Random No Y: 0,4405438
L_intYcoor: 341
Random No X: 0,9987844
L_intXcoor: 1030
L_objAUT.ClickM(1028,341,skNoShift)
There was an attempt to perform an action at a point, which is beyond the screen.
Screen coordinates of the point: (1024, 337)
What gives? The point that was clicked was inside the size of the application, so why am I getting this error? And another question, why is the screen coordinates 4 pixels off from the mouse click coordinates?
Hope someone can help me out
Best regards
Lars Lund Olsen