With Microsoft’s Visual Studio having an integrated development and test environment, we’ve been working with several customers using Coded UI for test automation. Coded UI is a new capability of Visual Studio 2010 which provides a way to create fully automated tests to validate the functionality and behavior of your application’s user interface.

The following are some benefits from using Coded UI:

  1. Support for Microsoft technologies (e.g.  Dot net): With the application developed by Microsoft technology, the objects contained in the application can be easily recognized by Coded UI and the properties of objects are visible.
  2. Friendly UI for automation testers to create scripts: Not only because it is based on C# and Visual Studio IDE, but also it delivers an additional GUI to help testers modify the existing scripts (this feature is in service pack 2).
  3. Easily integrated into TFS server and controlled by Test Manager. By using Test Manager, testers can decide when the automation scripts to be executed and which machine (physical/virtual) to execute them on. The automation scripts will be executed automatically based on the schedule and then the results will be reported.

However there are some limitations in Coded UI. For example, it does not support Flash and Flex technology and currently only supports IE and Firefox browsers.

Based on my experience, I’ve listed out 5 tips in implementing Coded UI for test automation to help you save some time and get on the fast track:

  1. Install Visual Studio service pack2. Be sure to install this as it contains the graphic editor to edit Coded UI test and it allows creating automation test for Silverlight 4 and Firefox.
  2. Design an automation framework first. A suitable framework provides a well-organized script structure to make the automation scripts more flexible and reusable.
  3. Use multiple UI Maps if the application is complicated or if you have more than 2 testers writing the scripts at the same time.
  4. Use Test Manager to record the steps and then import the recorded scripts into the framework. By doing this all imported scripts contain the same coding standards which make it easier to read, track and maintain.
  5. If you are using Test Manager to manage the testing process, try to integrate Coded UI with Test Manager. By doing this all automation tests are connected to the related test cases or defects which make the testing process more effective.

Visit the MSDN forum to learn more about Visual Studio and Coded UI: http://social.msdn.microsoft.com/Forums/en-US/vsautotest/threads