Share via


How to: Locate All Descendants of a Container Control Using the Coded UI Test Editor

By using the Coded UI Test Editor, you can open a coded UI test for viewing and editing. You can also select a control listed in the UI control map and view its location in the application under test. For more information, see How to: Locate a Control in the Application under Test Using the Coded UI Test Editor. In addition to locating a control, you can also verify that all the controls under a container control can be located in the application under test. This can be helpful for the following situations:

  • Verifying search property changes you might have made on the container. For more information, see How to: Edit Control Properties Using the Coded UI Test Editor.

  • If there have been significant changes in the UI of the application under test, you can validate that the existing control search properties are still correct.

Opening a Coded UI Test in the Coded UI Test Editor

Follow these steps to open an existing coded UI test for editing in the Coded UI Test Editor.

To open a coded UI test in the Coded UI Test Editor

  1. In Solution Explorer, locate UIMap.uitest in your test project.

  2. Right-click UIMap.uitest and select Open.

    -or-

    Double-click UIMap.uitest.

    The coded UI test is displayed in the Coded UI Test Editor. You can now view and edit the coded UI test. For more information, see Editing Coded UI Tests Using the Coded UI Test Editor and How to: Edit a Coded UI Test Using the Coded UI Test Editor.

Locating a Control and its Descendants

Follow these steps to locate a control and its descendants in your coded UI tests.

Locate all descendant controlsAll controls located

To locate a control and its descendants

  1. Verify that the application associated with the test is running.

  2. In the UI Control Map pane, select the container control that you want to locate and view all the descendants for.

  3. Right-click the control and click Locate All.

    The container control, and all its descendant controls, are marked with either a green check mark or a red ‘X’ in the Coded UI Test Editor. These marks let you know if the controls were successfully located in the application under test.

  4. On the Visual Studio toolbar, click Save.

    The updates to the test method are saved in the UIMap.Designer file.

See Also

Tasks

How to: Edit Control Properties Using the Coded UI Test Editor

How to: Locate a Control in the Application under Test Using the Coded UI Test Editor

Other Resources

Editing Coded UI Tests Using the Coded UI Test Editor