We use UI Automation and Nunit to create tests UI tests for WPF application. We've created tests that work fine when you run them from a local machine. Those tests never run successfully on our build server (using TeamCity). Build always hang after opening application window. But if I am logged in (remote desktop), on our build server all UI Automation tests also run successfully. So I am guessing that it probably has something to do with running active windows session. Any ideas how to convince our build server to create active windows session or any other solutions for making those tests run on build server?
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- JFX scale image up and down to parent
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
Tests that instantiate the UI? That's not going to work, e.g. if you get a modal dialog the build will hang. This is the reason the MVP pattern was invented, to isolate the active presentation code from a concrete view.
Are you using a mock view in your automated tests?
You don't have many options. I will list the two I know, the most preferred option first:
Edit
Take a look at this TestComplete FAQ item: Can TestComplete execute scripts when the computer is locked?
It definatley sounds like you need to run your tests with an interactive session as opposed to a service. Adding the "Allow Service to interact with desktop" might help, but this is not supported in Vista any more apparently.
If you can run your builds interactivley as a command line, not a serivice that should work too.
We used to run our UIAutomation tests using the visual studo 2008 load agent to distribute them, running as a command line tool on VM's with no problem.
I also agree that you probably should't be running UI tests on a build server a part of your daily build.
OK, I'm just guessing here.
Try and run the TeamCity service with a local build server user instead of the system account. Maybe you have to login with that account once, before starting a new build.