UI testing is repetitive and time consuming. VS 2010 has added ‘Coded UI Test’ that allows us to create automated the UI test cases. This can save a lot of time and help in doing quick BVT (Build Verification Test). The following walkthrough demonstrates how to create automated UI tests using VS 2010.
Step 1: Create a new Test project in VS 2010
Lets begin by using File –> New Project menu item in VS 2010 to create a new Test project.
Step 2: Add a new Coded UI Test file to the project
Right click on the project and choose ‘Add –> Coded UI Test’ menu item.
This will add the necessary references to the project and bring up the ‘Generate Code for Coded UI Test’ dialog box.
Select the first option – ‘Record actions, edit UI map or add assertion’. This will bring up the recording screen at the bottom right of the screen. Click the red button to start the recording.
Step 3: Record the steps of the automated UI test
I will go to the Yahoo home page and browse to different pages.
Stop the recording and generate the code for the test by clicking the last button on the recording screen (shown in red border).
Step 4: Run the automated UI test case
Run the test case by clicking on Test –> Run –> All Tests in Solution. This will open the Yahoo home page and browse as per the recording done in the last step.
Make sure that the web browser is open before running the test case and you don’t change the mouse focus or press keys once the test case has started to run.
yeah this is good airtical to under standing for automated testing using vs 2010
its help full for only whose don’t know about automated testing
can u plz do one thing . plz proved code level testing ui testing ( UI tesing which means if testbox width change its also find in testing )