user2318645
user2318645

Reputation: 31

Coded ui objects in UIMap

I have a question regarding coded ui UIMap. Every time I record an action on the same application, coded ui generates a new object for the same window in the application. It looks like: UIAdminWindow

UIAdminWindow1

UIAdminWindow2

and so on... every window class holds different buttons, even though it's the same window. Thus it's very hard to keep code maintenance. What i would like is that every time i perform actions and records on a window, even if not at the same time, the already generated class for this window, will be updated with the new controls. any suggestions to why it happens?

Thanks a lot!

Upvotes: 2

Views: 1223

Answers (3)

Damaor
Damaor

Reputation: 39

In UIMap.uitest you can change the action name and the control name for better maintenance. For example: you can set UIAdminWindow as FirstAcessWindow or other name that will express comfortably the control or the action.

Upvotes: 1

Dmytro I.
Dmytro I.

Reputation: 324

What I can guess is that there is some randomly generated content or element identification data such as class or title that may be causing it. This may be caused by different username for example. Also you can update the element from UI map element tree.

Upvotes: 0

Richard Banks
Richard Banks

Reputation: 12546

You can clean up your UIMaps by doing two things:

  1. Use the UIMap Toolbox (from codeplex) to move controls within the UIMap so they are all under one control tree.
  2. When you have duplicate UI controls, go to the properties for the action that references the duplicate control and change the UI Control property to point to the original control in the UIMap.
  3. The duplicate trees should now be unreferenced and you can delete it from your map, keeping things clean.

And yes, it's a pain to do, but it's worth it for maintainability.

Upvotes: 1

Related Questions