How to hide/block pop-up windows of my tests on Windows
I have an automated testing program in Perl. When it is launched on Windows, it has pop-up windows, like Windows cmd console or SunAwtFrame, and I keep losing input focus. I don't want to watch my test for hours, instead I want to use my 12-core machine to do something else concurrently. My question is that can I hide/block the test GUI windows, or put all test processes in background (no GUI interruptions)? I have tried to use virtual desktops to hide my test pop-up Windows. First, VituaWin won't work for my case. All pop-up windows are shown on the current display desktop, not the original starting desktop. Second, Windows Sysinternals Desktop.exe seems to be a good candidate. It can hide all my test pop-ups in its starting desktop. However, I failed to automate the process; I did not find a way to use Win32::GuiTest and Windows Desktop API to launch apps from a different desktop. (This may explain why Sysinternal Desktop.exe does not offer such capability in their manual page.) Any help on this method? It seems to me what left on the table is to block GUI. Two options I can think of. First is to convert my perl test program into a Windows service, and launch tests in non-GUI mode. Second, install ssh-service on my Windows, and launch tests without X forwarding (via opensshd, or other ssh services). I personally prefer the second option (it also paves the way for distributed testing). Any recommendation/suggestion is highly appreciated on this topic.
GUI automation is very tricky to say the least. As a general rule of thumb GUI automation demands that the automated test 'know' the machine state at all times. This means that we shouldn't assume that a particular window has focus. If the automation requires a window to have focus it should check to make sure that window has focus and if not set focus to that window. Running your GUI automated tests concurrently on a main, or desktop machine seems very counter-intuitive since your test 'windows' will always want to be in the foreground. VMs my be another option, but if your functional tests can run successfully and provide you the information you need without having to manipulate the GUI, then IMHO that is a great approach and one we use quite often.