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?
Xvfb or X virtual framebuffer is a display server implementing the X11 display server protocol. In contrast to other display servers, Xvfb performs all graphical operations in virtual memory without showing any screen output.
You can use "Desktops" application from SysInternals package. Run UI tests on one desktop and work on another.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With