Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all articles
Browse latest Browse all 585

Modal Dialogs and UI automation

$
0
0

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


Viewing all articles
Browse latest Browse all 585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>