Ask a Question

Cannot perform a hovermouse action when the RDP is disconnected

SOLVED
harshad_w
Occasional Contributor

Cannot perform a hovermouse action when the RDP is disconnected

I am getting this error when trying to hover over a blank screen. "There was an attempt to perform an action at point (436, 504), which is out of the window bounds." There's no other dialog or window open when I perform the mouseHover. The x and y are screen coordinates. I wonder why it's not working when I am disconnected from RDP. Rest of the tests pass. Is there a setting in TestComplete to get rid of this problem? I am using 14.93 version of TestComplete.

 

I have used hoverMouse function in order to hover over a blank screen. It works if I am connected to VM using RDP connection. It fails when I am disconnected to VM and run the Azure pipeline. I am hovering 20 times using the below code. No other objects are present when performing mouseHover

 

hoverMouse(obj, x, y)
{
Delay(3000, "Trying to Hover the Cursor at Desired Position");
  for (i = 0; i<20; i++)
 {
  obj.HoverMouse(x,y)
  }
}

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
chriscc
Occasional Contributor

Re: Cannot perform a hovermouse action when the RDP is disconnected

Sorry Harshad, I miss understood your question. 

Instead of using a hover function can you try setting the built in Sys.Desktop.MouseX and Sys.Desktop.MouseY properties like this:

 

Sys.Desktop.MouseX = 436;

Sys.Desktop.MouseY = 504;

 

Hopefully, the mouse will move to the location when not connected through the Remote Desktop.

Chris

View solution in original post

2 REPLIES 2
chriscc
Occasional Contributor

Re: Cannot perform a hovermouse action when the RDP is disconnected

Hi Harshad.

 

Are you running multiple monitors? If so, they could have different resolution settings, or not aligned, which creates a much larger desktop than expected. That means you could be trying to click outside of the individual screens bounds.
A different resolution could look like this: 

 

Resolution.png

Or the monitors might not be aligned with respect to each other, like this:

Resolution2.png

This is what the screenshot of the widow crossing over monitor 3 and 1 looks like:

Resolution3.png

 

In TestComplete, if you try to click at the top of the window that is on monitor 3 then you would most likely get the error that you’re clicking outside of the screen bounds.  The white space above is still considered part of the desktop, but not the screen.


A quick easy test is to unplug all external monitors and run the test to see if it works.

 

There could be other things like DPI settings that could be causing the issue. If you do have multiple monitors check that the Scale and Layout settings (this is in the Display Settings).  If they are different then the coordinates that you are trying to select might not be the physical location on the screen.  You can try setting them all to the same value (might require a restart) and then try the test again.

 

Hopefully this helps.

Chris
chriscc
Occasional Contributor

Re: Cannot perform a hovermouse action when the RDP is disconnected

Sorry Harshad, I miss understood your question. 

Instead of using a hover function can you try setting the built in Sys.Desktop.MouseX and Sys.Desktop.MouseY properties like this:

 

Sys.Desktop.MouseX = 436;

Sys.Desktop.MouseY = 504;

 

Hopefully, the mouse will move to the location when not connected through the Remote Desktop.

Chris

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: