Microsoft Active Accessibility is a COM-based technology that provides a standard, consistent mechanism for applications and Active Accessibility
clients to exchange information. Additionally, it provides lightweight UI test automation. For more information refer to the following articles:
MSAA it is also a great automation tool, which Microsoft included in Visual Studio 2010. The automation allows developers to access and manipulate
all UI elements in applications
that support it. However, at this point only the standard Windows Forms controls have support for this technology, and it is quite limited
RadControls for WinForms allow you to createa a simple coded UI test using MSAA in a few mouse clicks (we are using RadListControl for
the purpose of this demo). Here is how this works:
-
Let's choose "Coded UI Test" from Visual Studio's Test menu. Press OK
-
Choose the first option -- "Record actions, edit UI map or add assertions"
-
Then, start an application using RadControls for Winforms - in our case this is a form with RadListControl.
-
Once the test has been recorded, choose "Generate Code" from the Record window and then add aDebug.Assert call manually to check the value,
for example, of the SelectedIndex property:
CopyC#
Mouse.Click(uIListItem1ListItem, new Point(47, 33));
Assert.AreEqual(this.UIRadListControlTestWindow.GetProperty("SelectedIndex"), 1);
CopyVB.NET
Mouse.Click(uIListItem1ListItem, New Point(47, 33))
Assert.AreEqual(Me.UIRadListControlTestWindow.GetProperty("SelectedIndex"), 1) - Finally, select the test from Visual Studio and run the test in the current context.
After you execute these steps, you will see how Visual Studio's [automated] test opens the form and presses the second
item of RadListControl. The test will fail if RadListControl SelectIndex is not equal to 1.