Nick V
Nick V

Reputation: 1843

The namespace of a Coded UI Test Map (UIMap.uitest)?

Does anybody know how one can change the namespace of a "Coded UI Test Map" also known as UIMap? Or how the designer does the naming?

When adding a UIMap to your project, you get to cs-files:

e.g.

  1. UIMap.cs
  2. UIMap.Designer.cs

The designer file is auto generated (thus not for editing yourself) and the other file is for own customizations.

In my case I want to change the namespace of both files because I added some folders to organise stuff. What I did was manually changing the namespace of both files. But since the designer generates file 2) the namespace was also changed again, screwing up my references. Now I hoped to find a property to enter my own namespace naming. The property I found was for the file "UIMap.uitest", named "Custom Tool Namespace". This property didn't do the trick. I also had a look in the xml of "UIMap.uitest" to find a namespace reference but again no success. So I guess the naming is hardcoded by the designer...

The designer always generates this namespace:

namespace TestProject.UIMaps.UIMapClasses

Can anybody confirm the namespace naming convention by the designer? Or knows a way to manually fix it?

Upvotes: 1

Views: 1466

Answers (1)

Jim
Jim

Reputation: 11

If you are talking about the root namespace, it's in the project properties dialog

  1. right click the project
  2. select the properties menu item
  3. on the application tab, look for the Default namespace: text box and put what you want in there. It can consist of several levels e.g.

BigNamespace.CompanyNamespace.ITProject.Solution.Project..... etc. when you perform any action that will require a rewrite of the file, those namespace lines get rewritten. Or you can do it by hand. I looked it up because it was giving me heartburn too.

Upvotes: 1

Related Questions