1

I have very similar problem to this one : SetForegroundWindow in Remote Desktop Connection Everything works when I am connected and watching the RDC, but when I'm not.. Nothing happens. I am using python and pywinauto, trying to use SendKeys method : SetForegroundWindow returns 0, the same as GetLastError after that, so I have no idea what might cause the trouble.

Edit: I also tried other methods like BringWindowToTop, or SetActiveWindow, also I tried to sent alt key before changing windows - nothing worked.

Community
  • 1
  • 1
Muco
  • 27
  • 9

1 Answers1

0

If your pywinauto script works on remote machine, it cannot manage RDP window at all because RDP window is on your local machine.

To prevent lost of GUI context in RDP you do NOT need to minimize RDP window locally. RDP can lose focus safely, but minimizing leads to stop of any GUI related activity.

It's correct for any GUI automation, not pywinauto only. If you have a lot of test machines, the best way is having 1 master and many slaves. Master host can initiate and keep non-minimized remote sessions, slaves are running GUI automation scripts.

Vasily Ryabov
  • 9,386
  • 6
  • 25
  • 78
  • So there is no option for that working without having remote desktop opened and not minimized? – Muco Aug 10 '15 at 12:42
  • I don't know about such options. Testing teams in our company use the described master-slave approach for that. If you want to continue work on local machine, just switch to another window after turning full-screen mode off. – Vasily Ryabov Aug 10 '15 at 12:53