Export (0) Print
Expand All

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

Visual Studio 2010

By using the Coded UI Test Editor, you can open a coded UI test for editing and modify the properties for specific controls.

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.

Follow these steps to edit the properties for the controls that are used in your coded UI tests.

Control properties

To edit control properties

  1. In the UI Control Map pane, select the control that you want to edit.

    TipTip

    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 application under test. For more information, see How to: Locate a Control in the Application under Test Using the Coded UI Test Editor.

    NoteNote

    It might be necessary to expand the container control that contains the control that you want to edit. For more information, see How to: Locate All Descendants of a Container Control Using the Coded UI Test Editor.

    TipTip

    When you select a UI action that is located in a method in the UI Actions pane, the corresponding control is highlighted.

  2. If the Properties window is not displayed, press F4. In the Properties window, change the value for the property you want to change.

    For example, a developer might have changed the (ID) property on a button control in the source code for the application being tested from “idSubmit” to “idLogin.” With the (ID) property changed in the application, the coded UI test will not be able to locate the button control and will fail. In this case, the tester can open the Search Properties collection and change the Id property to match the new value that the developer used in the application. The tester could also change the Friendly Name property value from “Submit” to “Login.” By making this change, the associated UI action in the Coded UI Test Editor is updated from “Click ‘Submit’ button” to “Click ‘Login’ button.”

    TipTip

    You can verify search property changes that you made to a control using Locate the UI Control. For more information, see How to: Locate a Control in the Application under Test Using the Coded UI Test Editor.

    TipTip

    You can use the Find button in the Coded UI Test editor toolbar to open the Find and Replace tool in Visual Studio. You can then use the Find control to locate a UI action in the Coded UI Test editor. For example, you can try to find “Click ‘Login’ button.” This can be useful in large tests. Note that you cannot use the replace functionality in the Find and Replace tool in the Coded UI Test Editor. For more information, see Find control in Finding and Replacing.

    TipTip

    You can undo the property changes you made. Choose Undo from the Edit menu, or press Ctrl+Z.

  3. On the Visual Studio toolbar, click Save.

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

Community Additions

ADD
Show:
© 2014 Microsoft