This blog briefly introduces a new plug-in tool for Coded UI test automation. Coded UI is the automation testing tool which is included in Visio Studio 2010 and is becoming more and more popular. Coded UI has many advantages such as the integration with TFS (Team Foundation Server) and the support of Silverlight. However, there are still some limitations compared to other more mature test automation tools. One of the biggest issues is that in Coded UI, the code for defining objects is mixed in with the automation scripts which cause difficulties when it comes to maintenance.

Recently, I found a new plug-in for Coded UI, CUITe, that helps to solve this problem as it separates UI object definition from automation code. It basically works as follows:

After installing CUITe, the user can start another object recording tool.

1

Then when you move the mouse over the object, the related HTML will be displayed and if you want to add this object definition, just click it and the HTML definition will be added on the bottom of the tool.

The next step is to create a Coded UI project, add an Object Repository folder and add the object definition to the correct file. Before doing that, the user also needs to do some configuration work to connect Coded UI to CUITe and set the architecture-structure of the object repository folder.

After finishing the definition of the object, you can easily use it in your automation code.

3

As mentioned above, CUITe separates the object definition from the automation code which brings several benefits:

–          Easily manage and track object definitions

–          Improve code readability

–          Easier to maintain the code if there is a change

Additionally, CUITe also provides some other good features:

–          GetEmbeddedCheckBox(), Check2(), Select2() –> better consistency

–          JavaScript support

–          Support for custom UI objects

In summary, CUITe enhances the function of Coded UI and provides many benefits for test automation engineers. The CUITe is also an open source free plug-in and I definitely recommend this powerful tool when using Coded UI for test automation projects.