Coded UI Testing with Multiple UI Maps (Detailed)

   Posted by: Tim Star

 

Intro

This will be a series of posts on creating and maintaining Coded UI tests with Multiple UI maps. My intent here is to give a little more detail to help those new to Visual Studio.

Part 1: Creating a new Coded UI solution

Part 2: Adding a New UI Map

Part 3: Modifying an Existing Coded UI Map

Part 4: Adding a UI Map to the TestRunUtility

Part 5: Assembling the test

Part 6: Changing Recorded Methods

Part 7: Deleting actions when recording with the Coded UI Test Builder

Part 8: Modifying Generated Code

Credits

This technique is an extension of the technique found in the following links by Anu , a Program Manager in the Visual Studio ALM Test Tools group and the MDSN documentation. http://blogs.msdn.com/b/anutthara/archive/2010/02/08/scaling-up-your-cuit-ui-automation-for-real-world-projects.aspx

http://blogs.msdn.com/b/anutthara/archive/2010/02/10/walkthrough-using-multiple-coded-ui-maps-in-test-automation.aspx

http://msdn.microsoft.com/en-us/library/ff398056.aspx

Assumptions

My assumption is you have access to the Tail Spin Toys web site freely available on the Visual Studio RTM Virtual Machine (*Note: the VM expires every several months so this link may be stale after November 2011) I am also assuming you are logged in as the user Abu and that you have VS 2010 feature pack 2

Note, as the code is written in C#, casing of the code is important. strVariable is different than strvariable and this can give those new to c# programming fits so take care to match the exact naming conventions in the following examples.

 

Creating a New CUIT Solution

Open Visual Studio 2010 -

From the start menu select All Programs -> Microsoft Visual Studio 2010 -> Microsoft Visual Studio 2010

image

From the start page select File -> New -> Project

image

Highlight the Test Template -> select Test Project -> give the project a meaningful name -> select OK

image

In solution Explorer, right click UnitTest1.cs -> select delete -> Click the OK button on the warning dialog.

image

In solution explorer right click the project -> select Add -> select Coded UI test?

image

Select Cancel

image

Right click the solution -> select Add -> select New Folder -> Name the Folder Utility

image

Again right click the solution -> select Add -> select New Folder -> Name the Folder UI Maps

image

Your solution should now look like this (don?t worry about the yellow + icons, you will not see those if you are not using version control):

image

At this point we have an essentially empty solution and we are ready to start adding UI Maps.  In the next post we will do just that.


Comments (3)

TAG 7/28/2011 9:31 AM

Its really kooool information. I have a request...can you complete it ASAP. I want to know about the next steps.
Thanks for great work.

Jeff 12/12/2011 5:36 PM

I appreciate this post elaborating on one of Microsoft's best practices. But I can show a FAR better approach that will cut coding time in half or more, and reduce your code base by 3/4 of the size. Maybe you should hire me! Smile

solar power systems 1/18/2012 3:34 AM

your blog contain really good information to aware people....thanks a lot for sharing such an informative post !!

Add a Comment

*

*

Loading

Find Us
Contact Us 651-288-7000 1-800-866-9884
Home | Training | Curriculum | Course Finder | Schedule | Enroll | Twin Cities Java User Group | Consulting | Foundation | Jobs | About Us | Our Story | Press Room | Instructors | President | Map & Directions | Sitemap

Java Training | JSF / Struts / Spring / Hibernate Training | Java Power Tools Training | .NET 4.0 & Visual Studio 2010 Training | Microsoft Web Development Training | Prism / MVVM / MEF Training | .NET 3.5 and Visual Studio 2008 Training | .NET 2.0 and Visual Studio 2003 Training | Cloud Computing Training | Ajax / Web Services / XML Training | Groovy and Grails Training | SQL Server 2012 Training | SQL Server 2008 Training | SQL Server 2005 Training | Mobile Development Training | SharePoint 2010 Training | SharePoint 2007 Training | Agile, Process, Analysis & Design Training | Arch/Design Patterns Training | Microsoft Official Curriculum Training | Web Development Training | Ruby Training | Rational Application Developer (RAD) Training | WebSphere Application Server Training | WebSphere Portal Training | WebLogic Training | Boot Camp Training | Project Management Training | C / C++ Training | Metro / WinRT / Windows 8 Development Training | Retired

Intertech delivers training on-site and virtually serving cities including Phoenix, AZ | San Francisco, CA | Los Angeles, CA | San Diego, CA | San Jose, CA | Washington, DC | Chicago, IL | Orlando, FL | Boston, MA | Duluth, MN | Minneapolis St. Paul, MN | Rochester, MN | Raleigh-Durham, NC | New York, NY | Philadelphia, PA | Austin, TX | Dallas, TX | Houston, TX | Seattle, WA.