Ranorex attepts to click on off screen items.
Posted: Thu Mar 03, 2011 7:51 am
Hi
While analyzing strange failed night run I noticed that the window of AUT was partially off screen and that button that was supposed to be clicked was not visible. Unfortunately Ranorex moved the mouse as far as it could and clicked anyway. Button that at that time was under mouse cursor opened a new unexplored and unexpected window in our application and caused failed run. When trying it out a bit it seems that Ranorex clicks regardless of where the mouse actually is. Since mouse can't move outside the left border of the screen and for some reason application windows can this can cause strange behavior. Would it not be possible to check if mouse position is withing rectangle of object it wants to click before actually clicking?
Steps to reproduce:
1. Edit WinFormsTest sample form Ranorex so that: You have a Delay after application window is opened and clicking actually start. You stop or pause after Clicking on 'tabPage2' (step 2 of recording).
2. Run test, when application window is opened move it off left side of the screen so that 'tabpage2' is not visible but 'Image' tab is.
Happens:
When automation resumes it will click on 'Image' tab.
Should happen:
Automation fails because it can't click on 'tabpage2'
With all this said, I think it's only a minor bug, took me 6 months and new developer to stumble upon it and it could be easily solved on our side by either maximizing the aut window, or moving it to (1,1) (or whatever is top left with multiple displays).
While analyzing strange failed night run I noticed that the window of AUT was partially off screen and that button that was supposed to be clicked was not visible. Unfortunately Ranorex moved the mouse as far as it could and clicked anyway. Button that at that time was under mouse cursor opened a new unexplored and unexpected window in our application and caused failed run. When trying it out a bit it seems that Ranorex clicks regardless of where the mouse actually is. Since mouse can't move outside the left border of the screen and for some reason application windows can this can cause strange behavior. Would it not be possible to check if mouse position is withing rectangle of object it wants to click before actually clicking?
Steps to reproduce:
1. Edit WinFormsTest sample form Ranorex so that: You have a Delay after application window is opened and clicking actually start. You stop or pause after Clicking on 'tabPage2' (step 2 of recording).
2. Run test, when application window is opened move it off left side of the screen so that 'tabpage2' is not visible but 'Image' tab is.
Happens:
When automation resumes it will click on 'Image' tab.
Should happen:
Automation fails because it can't click on 'tabpage2'
With all this said, I think it's only a minor bug, took me 6 months and new developer to stumble upon it and it could be easily solved on our side by either maximizing the aut window, or moving it to (1,1) (or whatever is top left with multiple displays).