Coded UI Examples

Free resources for building automation based on Microsoft's CodedUI Framework.

Learn more »

Getting started

There are three parts to the Coded UI Extension library.

  1. Coded UI Fluent
    • Additional HTML controls to provide clean, consistent search expressions.
    • Fluent extensions to reduce the amount of code required to find UI Test Controls while also improving the readability of the search expression.
    • Extends the existing Coded UI type hierarchy to be fully compatible with exisitng tests using Coded UI.
  2. Page Modeling Abstraction
    • Platform agnostic set of abstractions over UI capabilities.
    • Express UI in terms of simple interfaces likes:
      • IClickable
      • ISelectable
      • IValuable
      • ...
  3. Coded UI Implementation of the Page Modeling Abstraction
    • Let the framework provide consistent semantics for testing your UI
    • Separate modeling pages of your application from the tests against them

Find on Nuget »

Examples

Examples and comparison of standard Coded UI scripts and using the extension libraries.

These examples work with the source code and act as the actual tests to validate the framework functionality. You can download the source code from github and run the tests to see exactly how the code works.

  1. Simple Html Input Controls
    Examples of manipulating various html input controls.
  2. Static Child (Nested Controls)
    Examples of how to use the Static Child base class for distinguishing nested controls on a page.
Here is a set of refactorings to understand why Page Objects and Page Models can help your test code.
  1. Initial Requirements Initial sample app tests with no strategy for how to perform testing.
  2. Hide Confirm Password First requirement change to hide the confirm password input until both username and password have been set.
  3. Hide Register Button Second requirement change to hide the register button until both username and password have been set.
  4. Add Orders Page Add an Orders page where logged in users can place orders.
  5. Add and Cancel Buttons First change to Orders page to not show new order fields until the Add button is clicked. Also, include a cancel button which will hide the new order fields.
  6. Quantity and Delete Second change to the Orders page to add a quantity field which only shows when an Order ID has been set. Also, add a delete button to the orders table for each order.
  7. Account Required Require that the user has first and last name before entering orders.

Find on Github »