Saturday, 9 July 2011

What is Coded UI?

For many years the QA industry has used been dominated by HP, IBM and other software vendors that offered up their solutions to automated testing, and more specifically automated testing of user interfaces.

Now Microsoft has joined in the fray and wants a piece of the valuable candy, a piece of the QA industry. With the introduction of CodedUI as an integrated component of Visual Studio Premium and Ultimate, Microsoft now has the ability to offer a fresh alternative to HP's QuickTest Professional, IBM Rational Functional Tester and other lovely tools.


The anatomy of a CodedUI test is quite simple and can be broken down into the following files:
  • UIMap.uitest: Contains an XML representation of the UIMap class which includes windows, controls, properties, methods, assertions and actions.
Figure 1: UIMap.uitest

  • UIMap.designer.vb: The designer contains the code view of the UIMap which is usually generated when a tester records some UI interaction or when objects are manually added to the UIMap.
Figure 2: UIMap.Designer.vb
  • UIMap.vb: Any customization done to the UIMap are to be stored in this file. If changes are made directly to the UIMap.designer.vb file, those changes will be lost if a recording is done, as the file is regenerated. The screenshot below shows essentially a blank file. We will populate this file in the future parts of the tutorial.

Figure 3: UIMap.vb
  • CodedUITest1.vb: Contains the actual CodedUI test class, method invocation, and assertion invocation. All methods and assertions are by default invoked from the UIMap.designer.vb file.
Figure 4: CodedUITest1.vb

As you can see, the overall structure of a test is very simple and logically outlined. This makes the initial phases of UI automation fairly quick while offering great flexibility with the ability to write customized code behind the test methods.

Anyways, I hope this serves as a good introduction to CodedUI. The next post in this series will cover creation of CodedUI tests using the CodedUI Test Builder.

Happy testing!
Lefty



3 comments:

  1. hi i want to be gust writer of your blog

    ReplyDelete
  2. Did not tell what Coded UI actually does until very end of the article....A tool for UI automation.

    ReplyDelete
  3. Nothing is said about parametrized test cases - are they supported?
    It seems that actions (mouse clicking) are dependent on UI element positions.

    First impression - MS just liked to get some chunk in UI Automation tool marked without offering something which is close to SilkTest, QTP or TestComplete.

    ReplyDelete

Note: only a member of this blog may post a comment.