Coded UI Editor – Guide

18/11/2010

Coded UI Editor – Guide

Feature Pack 2 is Available! and it’s Awesome!

The feature pack comes with some great features and the one I want to talk about in this post is – Coded UI Test Editor.

I’ve recorded a simple CUIT on Windows Calculator that adds to numbers and show the result.

Getting Started

After you install the Feature Pack 2 you will notice that Double Click or Right click on “UIMap.uitest” file will open a new window contains all CUIT Actions.

image

The new screen contains the Method Names (When you generate the code), the actions under each Method and on the right you can see the controls relate to those method.

image

Method Properties

While selecting the Method you may perform the following Actions:

image

  1. Find the method use in the entire CodedUI Test.
  2. Delete those Method – (Next Time you Generate the CUIT this method will not be Generate)
  3. Change Method Name.
  4. Move the Method to UIMap.cs –Why? Very good questions – Any code Changes you will make in “UIMap.Designer.cs” will be overwritten once you generate new code for the CUIT.
    The result of moving the code will be a follow:

image

Action Properties

While selecting the Method you may perform the following Actions:

image

  1. Properties – For each action you can modify the properties.
    Foe example – Change Mouse action to Double Click instead of Click.
  2. Split into a new method
    image
  3. Inset Delay Before – The delay in milliseconds
    image

 

Controls Properties

During the CUIT Code Generation each control contain the search properties in order to identify that control during playback – those properties called “Search Criteria”.

Until today those search criteria was static and cannot be change without code customizations, now using Coded UI Editor you can define what are the properties you wan to use in order to Define you control in the best way!

image

Example – Very common scenario for recording applications using CUIT is the Window Title, the window title isn’t static and can be change and this can herm CUIT playback.

Using Coded UI Editor you can change that criteria or add new criteria for identifying that window not just by the Title.

image

To Improve CUIT playback performance you can add more “Search Criteria” to help CUIT to identify the control faster.

image

Enjoy

Add comment
facebook linkedin twitter email

Leave a Reply

3 comments

  1. Andrew Brown18/11/2010 ב 22:05

    Wow, this is awesome! I just typed up a short document earlier today comparing Rational Functional Tester vs Microsoft Coded UI Tests. I mentioned the features in this tool as one of the few pitfalls for CUIT since they were missing.

    Now the only things that are missing are:

    1. Ability to reverse-engineer the UIMap.uitest back into actions in the Coded UI Test Builder.
    2. Ability to insert an action above a previous action when recording a method. Currently only deleting a previous action is possible.

    Thanks for the post!

  2. Karthik24/11/2010 ב 16:20

    There should an option to add control by locating it from UI in Coded UI Editor like the option(cross hair) in Coded Ui Test Builder.

  3. Vince A.21/12/2010 ב 23:56

    If only there were a way to stop Visual Studio from minimizing when locating a control…