Page 1 of 1

.Click() issue watching automation via remote desktop

Posted: Thu May 24, 2012 12:51 am
by lyn5000
I'm seeing random behavior when using Validate.Exists() and .Click() for various Ranorex adapters in web pages when watching the automation via a remote desktop window.

When I'm NOT using remote desktop and am watching the automation run on the screen connected directly to the machine (Windows 7) that is running the automation directly from Ranorex Studio it works perfectly.

However when I remote desktop to that same machine and start the automation on that same machine using the remote desktop window and watch the automation, it behaves randomly. The code executes a Validate.Exists() for a specific web page adapter such as a button and then calls .Click() on that same adapter. These two calls do not fail in the code (no exception), however even though the .Click() call succeeded the adapter is not actually clicked in the web page (I can see the mouse over the adapter on the page but the .Click() call appears to have done nothing).

I've tried increasing Mouse.DefaultClickTime but I still get this random behavior via remote desktop. Sometimes the .Click() to an adapter actually clicks it but sometimes it doesn't even though .Click() in the code did not fail.

I've also tried adding Ranorex.Delay delays of a couple of seconds before every .Validate and .Click call and it helps but I'm not clear on why I need to do this to accommodate remote desktop running.

What do I need to do to compensate for whatever difference the remote desktop session is making?

Re: .Click() issue watching automation via remote desktop

Posted: Thu May 24, 2012 6:08 pm
by Support Team
I am not sure what would cause this behavior, and I am not aware of any issues with remote desktop and web automation. The only thing you have to make sure is that the remote desktop window is not minimized or disconnected during automation (because this causes the desktop to become inactive on the remote side).

Please post your Ranorex Version, OS Version (where the automation is running) and browser type / version.
Does this happen with other UI technologies (for example with one of the Ranorex samples?)

Michael
Ranorex Team

Re: .Click() issue watching automation via remote desktop

Posted: Fri May 25, 2012 10:25 am
by Patrik
Hello together,

i had very similar problems using Click() when executing automated tests via RDP - for me i found the solution here:

http://www.ranorex.com/support/user-gui ... norex.html

Especially disable Mouse/Keyboard Activities resolved the Click problem:
Use this code in the Program.cs file:

Code: Select all

Keyboard.Enabled = false; 
Mouse.Enabled = false; 
Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;  
Cheers,
Patrik

Re: .Click() issue watching automation via remote desktop

Posted: Fri May 25, 2012 11:43 pm
by lyn5000
Thank you! Setting Keyboard.Enabled and Mouse.Enabled to false solved the problem even though I was not using the keyboard or moving the mouse on the client running remote desktop while the automation was running and those properties can be set to true when not using remote desktop and there is no problem.

OS on both the client running remote desktop and machine running the automation FYI: Windows 7, Ranorex 3.2.3.16825, IE9.