ExecuteAutomation

Understanding Coded UI Recorded Code from UIMap

As we already discuss in previous post, Coded UI Test builder automatically generates couple of class files or otherwise called as UIMaps. UIMaps are more like Object Repository in QTP and Name mapping feature in Test Complete. One project can have more than one UIMaps, so that we can split and store objects in these UIMap to reduce confusion and clear distinction in project, but still, let’s see how Coded UI Test builder records and stores application objects in it.

Deep Dive in to UIMap.Designer.cs file

All the methods, classes and properties created with UIMap.Designer.cs file are automatically generated, hence any change made in UIMap.Designer.cs file will be deleted once new recording of code is done via Coded UI Test builder. As you can see in the below screenshot, the UIMap class file is decorated with GeneratedCode attribute

Recorded Method is the actual method which holds all the action which is performed in the Coded UI Test Builder as shown below

As you can see the above code, each and every control (button in this case) is first created as an instance with its type and then assigned with its search properties. We will talk more above search properties and filter properties later in this series of post, but for now just consider that each control is assigned with a search property and then using Mouse.Clickthese controls are performed click operations. Let’s, discuss the more detailed version of the same topic in video. Please leave your comments!!! Thanks, Karthik KK