Hi,
I am playing around with WPF and Automation trying to do the following.
Application A: Display a WPF window with a Button. The button has a handler - when clicked you get a message box.
Application B: Automation Controller (unit test). The code starts an in instance of A, and programatically (AutomationElement) pushes the button, which launches the message box. So far all of this works.
When I use the UI Spy program, I notice that when I do things manually, the message box is a child of the main window in the visual tree. When I run things through the automation controller, the message box seems to be a sibling of A in terms of Window hierarchy (and no longer modal!). This sort of makes sense, but the documentation (Invoke) says that a modal dialog will stop everything. Is the behaviour I am seeing correct?
I would like Application B not only to launch the 'modal' dialog, but also to test (get) that both Window title and message are correct; then I would like to programmatically push the OK button to make the message box disappear -- is this is possible?
Friedrich Brunzema