Coded UI tests: Visual Studio Crashed while moving code from UIMap.Designer.cs to UIMap.cs from Coded UI Test Editor

Few days ago I encountered an error. When I try to move a recorded function from UIMap.designer.cs to UIMap.cs, visual studio got crashed.

I was unable to find why it stopped working correctly. After searching on forums etc I still get no clue.

Then I begin to inspect my code files and loaded a previous version of my solution and compared it to my current version. After few hours I was able to find the root cause.

The code written in the UIMAP.cs file should be in a specific order. The code should start like this.

*******************************************************************************

 namespace Saad.Maps.DMap

{

    using Microsoft.VisualStudio.TestTools.UITesting.WinControls;

    using System;

    using System.Collections.Generic;

    using System.Drawing;

    using System.Windows.Input;

    using System.CodeDom.Compiler;

    using System.Text.RegularExpressions;

    using Microsoft.VisualStudio.TestTools.UITest.Extension;

    using Microsoft.VisualStudio.TestTools.UITesting;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;

    using Mouse = Microsoft.VisualStudio.TestTools.UITesting.Mouse;

    using MouseButtons = System.Windows.Forms.MouseButtons;

   

    public partial class UIMap

    {

**********************************************************************

and my file was like that….

**********************************************************************

    using Microsoft.VisualStudio.TestTools.UITesting.WinControls;

    using System;

    using System.Collections.Generic;

    using System.Drawing;

    using System.Windows.Input;

    using System.CodeDom.Compiler;

    using System.Text.RegularExpressions;

    using Microsoft.VisualStudio.TestTools.UITest.Extension;

    using Microsoft.VisualStudio.TestTools.UITesting;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;

    using Mouse = Microsoft.VisualStudio.TestTools.UITesting.Mouse;

    using MouseButtons = System.Windows.Forms.MouseButtons;

    

namespace Saad.Maps.DMap

{

    public partial class UIMap

    {

***********************************************************************


Yeah, can you note the difference.

The using clause should come under namespace clause. If it is not the case , then coded ui test editor will not be able to move code in that UIMAP.cs file. If you correct the code sequence in the UIMAP.cs file and write using clause under namespace clause then you will be able to move code successfully.

I hope it will help somebody and this post should help Microsoft to remove that bug too.

About these ads

Tagged: , ,

4 thoughts on “Coded UI tests: Visual Studio Crashed while moving code from UIMap.Designer.cs to UIMap.cs from Coded UI Test Editor

  1. MSD November 26, 2012 at 10:08 am Reply

    Nice post. I encountered the same error and I am now able to resolve it. Thanks

  2. 4ourbit November 28, 2012 at 12:25 pm Reply

    Thank you. This helped me a lot and saved me hours of figuring out what went wrong.

    • joinsaad November 29, 2012 at 7:52 am Reply

      I am glad that it helped you.

  3. Coded UI Tests: Tutorials | Binary Clips January 27, 2014 at 2:33 pm Reply

    […] Coded UI tests: Visual Studio Crashed while moving code from UIMap.Designer.cs to UIMap.cs from Code… (binaryclips.wordpress.com) […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Believe !!! There are 101 ways to Automate

Come let us explore together...

selenium online training with expert

Any One can Learn Selenium, It's simple, It's robust

Automation Planet

Automate your best experience

The Software Testing Guide

Software Testing Guide, Links, Resources etc.

DOC SERVE

DocServe is a community for IT & Software professionals to find and share professional documents. Find free functional documents and free professional documents.

Dan Ashby

Blethering about Software Testing

Sharing ideas, Sharing experiences

Jaagrugta Failao - By Sunil Singhal

TechCrunch

Startup and Technology News

Ryan Burnham's Blog

Just another WordPress.com site

Binary Clips

Experiences, Products, Thoughts...all about technology

Emerging .NET Devs

A Registered User Group under INETA

DreamXtream's Blog

Its all about life, a geek's life.

Ahmed Nasr's Blog

Talk about ALM, TFS and AGILE

WordPress.com

WordPress.com is the best place for your personal blog or business site.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: