I am building some WPF coded ui tests, and am running into a recurring problem where alert dialogues are being sent behind the application window. If I drive the app manually I can click on an 'OK' / 'Cancel' action and the dialogue is dismissed as expected. However, when the test is running in Test Studio, as soon as the click happens the dialogue disappears behind the window, causing the test to fail. Can anybody think what the problem might be?