Sunday, June 22, 2014

Introduction to CodedUI Test


Write CodedUI Tests in different ways.

1. Record/Playback
2. Track Object Repository
3. Advanced Coding.

1. Record/Playback: In this way, you can record your steps and playback the recorded steps.

    Cons:
     a.  Huge code generation.
     b.  No waits for page loads, and controls.
     c.  No flexibility to edit our Designer.cs class to modify our Object Repository base.
     Pros:
     a.  You need not to be a programmer to write the test code.
     b.  Very Simple to automate tests.

2. Track Object Repository: In this way, you capture your controls to UIMaps using Test Builder and call the control objects to your test methods.

   Cons:
     a.  Huge code generation.
     b.  Title, Index dependencies make your scripts failure while running the test scripts using
          captured objects using Test Builder.
     c.  No flexibility to edit our Designer.cs class to modify our Object Repository base
   Pros:
    a. Effort to Track Objects is minimized using Test Builder.

3. Advanced Coding: In this way, you capture controls into your class files using API available. And you should be having a good knowledge in C#/VB.NET to write your CodedUI Tests.

 Cons:
  a. An Extra effort is needed to track controls to separate classes.

 Pros:
  a. Can make your tests title independent.
  b. Can make extension methods to identify controls instead of using regular code to identify controls.

A good start to write a CodedUI Test is to record a scenario using Test Builder and understand what the generated coded does.

CodedUI supports Latest Chrome Browser, Firefox26 version and IE11 browsers for web Application, WPF,  WinForms, Silverlight, and Dynamics Controls. Refer msdn blog to get the CodedUI Support matrix.

In the next blog you will find how you can start writing code to generate CodedUI Tests using Advanced coding option.

No comments:

Post a Comment