I have a WPF application and a set of GUI unit tests. These tests load the application and then move the mouse and click on things. This works fine if I run it while I'm logged in.
However, when the tests are running on our continuous integration server, the mouse always reports its position as (0,0). If I tell the mouse to move and then check its position, it's still (0,0).
We have the service running with "Allow service to interact with desktop" checked, and Environment.UserInteractive is true.
Also, if I start a test run locally and then lock my screen, the mouse has the same behavior (position always 0,0).
How can I use the mouse while running as a service?