10 out of 11 rated this helpful - Rate this topic

Testing the User Interface with Automated UI Tests

You can use Visual Studio 2010 Ultimate or Visual Studio 2010 Premium to create automated tests of the user interface (UI) known as coded UI tests. These tests provide functional testing of the user interface and validation of user interface controls. Automated UI tests enable you to test that the user interface is functioning correctly after code changes. They are quicker to run than manual tests. Therefore, you can run them more frequently.

Tasks

Associated Topics

Creating an Automated UI Test from an Existing Manual Test: You can create an automated UI test from an existing action recording from a manual test case.

Record User Actions to Create an Automated UI Test: You can record the user actions that you want to use to create an automated UI test and generate the code for a coded UI test from this recording. You can then add custom code to your coded UI test using the Code Editor.

Add UI Controls and Validation to Your Automated UI Test: You can add UI controls to your coded UI test and verify the values and the properties of the controls using the Coded UI Test Builder.

If you are testing a large application, you might have to use multiple UI maps to help create your coded UI tests.

Add Parameters from a Data Source to Use with Your Coded UI Test: You can make your coded UI test into a data-driven test by adding a data source for your test method and using the test context to run the test method for each set of data in your data source.

Link Test Cases to User Requirements: You can link your automated UI tests to user requirements. You can then determine how many automated tests you have for your user requirements.

Running Automated UI Tests: You can run coded UI tests directly from Microsoft Visual Studio 2010, from Microsoft Test Manager, from Team Foundation Build. Coded UI tests have to interact with the desktop when you run them, unlike other automated tests.

Adding Support for Custom Controls: The coded UI testing framework does not support every possible UI and might not support the UI you want to test. For example, you cannot immediately create a coded UI test of the UI for Microsoft Excel. However, you can create an extension to the coded UI testing framework that will support a custom control.

Best Practices for Coded UI Tests: You can write coded UI tests that reduce the effect of a changing UI on the program under test.

Note Note

By installing Microsoft Visual Studio 2010 Feature Pack 2, you can use Windows Internet Explorer 7 (or later versions) to record UI actions on a website or a Web-based application and then play back the tests using the Mozilla Firefox browser version 3.5 or 3.6. Additionally, the feature pack includes the Coded UI Test Editor which lets you easily modify your coded UI tests. Using the Coded UI Test Editor, you can locate, view, and edit your test methods. You can also edit UI actions and their associated controls in the UI control map. To download the feature pack, you must have either Visual Studio 2010 Ultimate, Visual Studio 2010 Premium or Test Professional 2010 with an MSDN subscription, Microsoft BizSpark, or MSDN Academic Alliance. For more information, see Recording Tests Using Windows Internet Explorer and Playing Back Using Mozilla Firefox, Editing Coded UI Tests Using the Coded UI Test Editor and Microsoft Visual Studio 2010 Feature Pack 2.

Running Automated Tests

You can run your coded UI tests to verify that the application meets the user's requirements. You can run coded UI tests by using Visual Studio 2010 Ultimate, Visual Studio 2010 Premium, or Visual Studio Test Professional 2010.

Supported Configurations and Platforms for Coded UI Tests and Action Recordings

If you want to verify which configurations are supported for coded UI tests, you can find the current list of operating systems, browsers, and supported technologies.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Web UI Automation: An approach using Coded UI API
http://webuiautomation.blogspot.in/
Do not see an option to create Coded UI tests
I am using VS 2010 ulitimate but I do not see an option to create Coded UI tests under Test Project -> Add . Am I missing something?
Parametizing object property values
Hi,

I have started newly with Coded UI & trying to learn things before starting to Automate
I have used QTP VB scripting before

Can anyone please let me know the following things

1.How do i manually add objects.Is there something like an Object repository similar to what we have in QTP where we can find the hierarchies[Window/Frame/Button], edit  etc.

2.Can i paramterize the object property values.
For example with a calculator app, I want to parametrize the value for the property 'Name' for the buttons in the calcaulator window

if i want to drive the test with multiple values & different operators eg 1. 4+3 : 2. 5-3 ; 3.8/2 etc

3.Can i have a single UI map for windows application.Which one is the best.Any suggestions.

4.Does anyone automate coded UI apart from the 'Record/palyback' stuff.Does anyone follow any frame work apart from 'Record/Palyback'

Answers would be greatly helpful

Thanks


Test automation for Silverlight
We have been using eggPlant from TestPlant.com for Silverlight testing and it greatly complements MVS test tools.
RE: Excel Office Edition
Thanks for your feedback. I have added a note indicating that the sample is currently only supported for Microsoft Excel 2010. This note should appear at the next update around the end of June 2011.
Excel Office Edition
Need to include the Versions of Microsoft Office these extensions might be able to support.