Coded UI test builder is a very important part of cuit: if you use the recording method to generate the script, it will always be with you; if you use the pure code method to write the script, she is also a good helper to help you find the attributes of the identifier control.
You can call up the window in two ways:
1. vsts menu bar test-> generate code for coded UI test-> use coded UI test builder...
2. right-click a coded UI test method marked with the [testmethod] property, right-click anywhere, right-click the menu-> generate code for coded UI test-> use coded UI test builder...
We recommend you use 2nd methods. Here, vsts seems to have a small bug (Version: 10.0.30319.1 remrel ):
The generate code for coded UI test menu item cannot be activated immediately under the test menu in the vsts menu bar
Bytes --------------------------------------------------------------------------------------------------------
Step 1: Click the coded UI test method without the [testmethod] attribute, right-click it, and confirm that the menu bar does not contain generate code for coded UI test;
Step 2: In the vsts menu bar, you can click "test" without the generate code for coded UI test item;
Step 3: move the cursor to the coded UI test method marked with the [testmethod] property. On the vsts menu bar, click the test menu and the generate code for coded UI test is still unavailable;
Step 4: move the cursor to the coded UI test method marked with the [testmethod] property, right-click it, and right-click the generate code for coded UI test item on the menu bar;
Step 5: Return to the vsts menu bar. The generate code for coded UI test item appears under the test menu.
Note the following points for coded UI test builder:
1. Some controls can be displayed only when you move the mouse over them. For such controls, you need to use the Windows key + I combination to locate them;
2. After locate to a control, a navigation key is displayed at the top of the pop-up property box. The hierarchical result tree of the control can be obtained through the control;
3. When selecting the unique identifier of a control, the attribute under the search category is preferred;
4. Identify the properties of the control. The more the control, the better it is. In this case, the control cannot be found for the name + classname attribute, but the control can be found only by using the name attribute instead of the classname attribute.