VS2010 – Coded UI Test
VS2010 – Coded UI Test
One of the most exciting features in Visual Studio 2010 is CodedUITest.
CodedUITest allows you to record screen actions to perform UI Testing.
Open visual studio 2010 and create new test project, add new CodedUITest.
CodedUITest appears and you can pick how do you want to record your test, in this post I'll demonstrate how to record CodedUITest using the Recorder.

CodedUITest recorder window appears.
Click "Record Actions" to start recording the test.

In my demo I open calc and perform couple of simple actions.
After you finish recording give your CoedeUITest name and click "Generate Method" .
Before you run the test you want to add validation rules for your CodedUITest.
Enter the "Add Assertions" tab click "Add UI Control".

Now drag the crosshair over the control you wish to create validation.

And click show properties , to view the selected control properties.

Now you can see all values related to the select control, mark the values you want to validation and set the right comparator and value.

After clicking ok you will see the validation inside the "Add Assertions" tab.
Now close the CodedUITest window and from Test View window run your CodedUITest.
Enjoy.