Coded UI is a UI testing framework.
Prerequisites for Coded UI :
Visual Studio 2012 or Visual Studio 2010 Premium or Ultimate. Incase you have not installed full versions of the Visual Studio 2010, install feature pack 2 for Visual Studio from here. http://msdn.microsoft.com/en-us/library/gg269474%28v=vs.100%29.aspx
What can you do with Coded UI ?
Demo : Testing Bing using Coded UI.
Open Visual Studio 2012. After installation you will see Coded UI Test project template in Test.
Select the first option to record.
1) Record actions 2) Show Recorded Steps 3) Add Assertions 4) Generate Code .
Open browser and type bing.com/ and click record.
Steps to record :
1) Type Visual Studio 2010 in the search box.
2) Click Search.
3) Click on back button of browser. Run the tests.
NOTE: While running the tests , the state of UI has to be same as and when recorded, so that the running test can locate the search box and execute tests.Else tests might fail.
Making your UI Test Data Driven.
Open Excel and enter data for your search list.
Save it as Data.csv. Add Data.csv to your project. Set its properties. Set Build Action to Content and Copy to Output Directory to Copy Always.
To take data from excel sheet , you will have to set the parameters as below.
public void CodedUITestMethod1()
this.UIMap.TestBingParams.UIEnteryoursearchtermEditText = TestContext.DataRow["SearchText"].ToString();
Run your tests. There you have data driven tests for Bing UI. Your search will be done for all the inputs.