Coded UI Test Recorder can be accessed from

1. Generate Code for Coded UI Test Dialog :

 image

 

2. Context menu in a Coded UI Test Method

image

3.  From the Test Menu

image

 

In all cases, it launches the Coded UI Test Builder.

image

 

Click on the Start Recording Button to start recording. You can also use Alt+R shortcut key.

image 

NOTE: It takes sometime (~3-5 secs on a 2GB Win7 box) to start the recorder. A progress bar is shown in case it takes longer to start.

You should start your testing only after the button changes to Pause Recording.

image

 

Other Features of Recorder

  • It is possible to Pause and Resume the recording.
  • All the recorded actions can be viewed by clicking the Show Recorded Steps button.  It is possible to pin this dialog so that you can view all actions being recorded.  This dialog will become semi-transparent when focus is removed from it.

image 

  • It is possible to delete actions from the Recorded Actions dialog. You can multi-select with Ctrl+Click. It is the user’s responsibility to ensure that the test remains consistent after deletion of individual steps.image
  • It is possible to select all actions with Ctrl+A. You can then delete all actions and reset the entire recording.
  • After recording a series of test steps, click on the Generate Code button to generate code for all recorded actions and include them in the specified recorded method. It is recommended that mnemonic names be given to recorded methods. It is also necessary to create methods for logical groups of test steps. This will help improve the readability and maintainability of the Coded UI Test.

image

  • If you need to perform actions on controls under the Coded UI Test Builder, you need to move the Coded UI Test Builder window to some other location.
  • Actions performed on the Coded UI Test Builder/ Recorded Actions Window or the Visual Studio which launched the Recorder will not be recorded.
  • An action log is generated for each action which is recorded. It is recommended that this be carefully reviewed while recording. If unnecessary actions are recorded, use the ‘Delete’ operation as appropriate.
  • When a small section of your user interface changes, it is recommended to re-record the actions on that section. This will be possible if you group small set of actions (in that section) into a recorded method. Each recorded method may be re-recorded.  You can pick an existing method from the Method Name combo-box to overwrite it with the set of re-recorded actions.