Forum Discussion

LarsO's avatar
LarsO
Occasional Contributor
14 years ago

Action at point beyond the the screen problem

Hi



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

3 Replies

  • LarsO's avatar
    LarsO
    Occasional Contributor


    I might add that the test is not run on a remote machine, and I am currently using TC 7.52.678.7



    Thanks



    -Lars

  • Hi Lars,





    Try to execute your test with the Notepad editor. Does the problem persist? Could you please zip your entire project suite folder along with the log of the test execution and send us the archive via our Contact Support form?