views:

874

answers:

2

On projects with end-to-end tests that drive the GUI, it is awkward to run the tests on a developer workstation because the GUI automation driver interferes with the desktop. It moves the mouse, steals focus away from apps we want to use, and can start typing text into the wrong application if we switch to another app during a test run.

On Linux we've solved this by running the application under test on a virtual X server (xvfb or xnest). With xnest we can watch the tests running but still use the real desktop without interference.

Is there anything equivalent for Windows?

+2  A: 

I found a freeware program called "RunProcess.exe" written by Frank P. Westlake that can run a process bound to the desktop of a non-interactive (e.g. off-screen) WindowStation. However, there is no source.

Therefore I've implemented my own version (simpler than Frank Westlake's) with Java and JNA. It's in the Window Licker repository in the tools module. The class is called com.objogate.wl.win32.RunOnDesktop. At some point I may port it to C and make it a normal command-line .exe, or maybe turn it into an Ant task for running tests off-screen.

Nat
A: 

You can use "Desktops" application from SysInternals package. Run UI tests on one desktop and work on another.

Yauheni Sivukha
Unfortunately I don't think that will work. What I want is to spawn a process from the IDE (running on my main desktop) and for that process' windows to appear on an off-screen desktop. That's not the way that "Desktops" appears to work.
Nat