Coded UI Test – Tip 2 – Assertions

18/07/2010

Coded UI Test – Tip 2 – Assertions

Visual Studio 2010 comes with many new features not just to developers and architects also for the Testing World, and the one I’m going to show to day is Coded UI Test – A functional , UI testing based on .NET code. (How to Record Coded UI Test?)

As you know Coded UI Is Very powerful UI automation, but recording automation is not enough and you need to do some validation – to check if the actions you made result in the right way.

For validation in Coded UI Testing you need to use “Assertions”, asset is also used in Unit Test to verify the actual and expected result (and more).

To add assert to your Coded UI Test run the “Coded UI Test Builder” drag the viewfinder on top the control you want to perform the validation.

image

You will see Blue marker showing you the control you are catching, release the mouse button to get a list of all properties available for the specific control.

image

Choose the property you want to validate and Click “Add Assertion”.

If you having problem catching a control you can use the navigation dial control.

You can use the navigation dial to move around in the UI Tree

The following 4 operations are possible with the navigation dial.

  1. Navigate to the parent of the selected control.(Alt+Up)
  2. Navigate to the first child of the selected control. (Alt+Down)
  3. Navigate to the peer control to the left of the selected control. (Alt+Left)
  4. Navigate to the peer control to the right of the selected control. (Alt+Right)

image image

Enjoy.

Add comment
facebook linkedin twitter email

Leave a Reply