DCSIMG
Coded UI Test – Tip 2 – Assertions - Shai Raiten

Shai Raiten

 Subscribe

Coded UI Test – Tip 2 – Assertions

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.

Comments

Twitter Trackbacks for Coded UI Test ??? Tip 2 ??? Assertions - Shai Raiten [microsoft.co.il] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Coded UI Test ??? Tip 2 ??? Assertions - Shai Raiten         [microsoft.co.il]        on Topsy.com

# July 19, 2010 4:46 PM

Shai Raiten said:

Coded UI Test – Tip 3 – Locate Controls Using Win + I In my last post we talked about Coded UI Test

# July 22, 2010 1:53 PM

Shai Raiten said:

Coded UI Test – Tip 4 – Add Unused Controls to UI Map If you are using Coded UI for advanced tests or

# August 8, 2010 10:59 AM

Automated Testing of Desktop Applications with Visual Studio 2010 Part 1: Coded UI Test ??? Insource Blog said:

Pingback from  Automated Testing of Desktop Applications with Visual Studio 2010 Part 1: Coded UI Test ??? Insource Blog

# November 16, 2010 6:04 PM

Automated Testing of Desktop Applications with Visual Studio 2010 Part 2: Coded UI Test Pitfalls ??? Insource Blog said:

Pingback from  Automated Testing of Desktop Applications with Visual Studio 2010 Part 2: Coded UI Test Pitfalls ??? Insource Blog

# November 18, 2010 6:13 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: