Page 1 of 1

Mouse Click doesn't work when the VM isn't on the foreground

Posted: Mon May 20, 2019 9:55 am
by pgirardin
Hello everyone !

The problem is exactly what the title is ^^

I have installed Ranorex 9.0.1 (last version when I post this) on a VM Windows Server 2018. My tests work correctly as long as I have the VM on the foreground. When I run the test and reduce the VM (going back to the physical machine), the clicks doesn't work, and there are some actions where I can't replace them by PerformClick. The test simply pass over it, like if there was no click command in the test.

Did this already happened to someone please ?

Thanks in advance !

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Mon May 20, 2019 12:49 pm
by odklizec
Hi,

Are you using remote desktop to connect to the VM? And do I understand it right, that you are minimizing the RDP window? If RDP window is minimized, RDP disconnects from target computer. To avoid this, you must either keep the RDP window maximized or apply an RDP hack to keep the RDP session alive. For more details about running tests in RDP environment, please check this FAQ post:
https://www.ranorex.com/help/latest/ran ... lRDPbrspan

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Mon May 20, 2019 1:26 pm
by pgirardin
Hello odklizec,

Thanks for your reply.

Yes I am using Remote Desktop to connect to the VM.
Yes I am minimizing the RDP window, sorry I translated it badly from french ^^"

I also have the same problem when using Jenkins. It runs the tests on another VM that I shouldn't have to connect to, and the click don't work. From what I read on the link you gave me, it is mandatory to let the RDP maximized, which is very problematic for me.

Is the .bat solution the only one ?

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Mon May 20, 2019 1:34 pm
by odklizec
Hi,

There are some other solutions to the RDP minimalization problem. You could try for example registry hack, described here:
https://docs.telerik.com/teststudio/kno ... imized-rdc

As for Jenkins, I would suggest to use LogonExpert tool, which keeps the session logged:
https://www.logonexpert.com/

For more details and suggestions, check this discussion:
https://www.ranorex.com/forum/problems- ... 13094.html

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Mon May 20, 2019 4:27 pm
by pgirardin
Hello,

I tried all the solutions, but the problem subsists without showing any new info...

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Tue May 21, 2019 11:30 am
by pgirardin
So, am I the only one with this problem ? :'(

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Tue May 21, 2019 11:36 am
by odklizec
Hi,

Unfortunately, without seeing your test workflow and Jenkins setup, there is not much anyone here can do or suggest. I'm using RDP and Jenkins on a daily basis and everything works as expected. So my best guess is, that there is something wrong with your setup?

As mentioned before, Ranorex requires realized desktop. So if you are using RDP, the RDP window must either stay maximized, or you must apply one of the available hacks to keep the connection alive, even after minimizing/closing RDP window.

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Tue May 21, 2019 2:37 pm
by pgirardin
Hi again,

Indeed, there must be something wrong with my setup... Do you have any idea of what could cause this kind of error ?

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Wed May 22, 2019 1:54 pm
by McTurtle
Hello pgirardin,

As odklizec said... There is nothing wrong with your setup, you simply have to implement one of the multiple hacks. Test automation is not possible when there is no GUI. This is a limitation of test automation. There is no GUI when you minimize the RDP session because Windows hides the whole user interface.

I always liked this approach the most: Batch file

Simply create the batch file and then instead of minimizing the RDP window, right click on the batch file and choose "Run as administrator".

Does this help?

Regards,
McTurtle

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Wed May 22, 2019 2:06 pm
by pgirardin
Hello McTurtle,

Thank you for your answer, now it works ! I simply forgot to run as administrator... :roll:

And same thanks to odklizec who also proposed the correct answer.

Re: Mouse Click doesn't work when the VM isn't on the foreground

Posted: Wed May 22, 2019 2:08 pm
by McTurtle
Hi pgirardin,

The devil is in the details ;)

Regards,
McTurtle