Share via


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

By using the Coded UI Test Editor, you can open a coded UI test for viewing and editing. Sometimes, it can be difficult to visualize where controls are located in the UI of the application under test. One of the capabilities of the coded UI Test Editor is that you can select a control listed in the UI control map and view its location in the applicationunder test. Using the Locate the UI Control feature on the application under test can also be used to verify search property modifications you have made to a control. For more information, see How to: Edit Control Properties Using the Coded UI Test Editor.

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 UI Control in the Application under Test

Follow these steps to identify a control’s location in the application under test from the Coded UI Test Editor.

Locate UI controlControl located in application under test

To locate a UI control

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

  2. In the UI Control Map pane, select the control that you want to locate in the application associated with the test.

  3. Right-click the control and then click Locate the UI Control.

    In the application that is being tested, the control is designated with a blue border.

    Tip

    Using Locate the UI Control to locate a control in the application under test can useful to verify search property modifications you have made to a control. For more information, see How to: Edit Control Properties Using the Coded UI Test Editor.

    Tip

    Alternatively, you can use the Locate All option to verify that all the controls under a container can be correctly located. For more information, see How to: Locate All Descendants of a Container Control Using the Coded UI Test Editor.

See Also

Tasks

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

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

Other Resources

Editing Coded UI Tests Using the Coded UI Test Editor