Add Objects In uimap.uitest file in the CodedUi Control map file

How to add objects in the uimap.uitest that is the CodedUi Control map file ?
        Do you actually know how the automation testing proceeds in a tool. It is very simple, we store the object's properties in some repository files and as and when we need to do some operation on those objects we identify those objects using some logical names that we might choose on our own and then call specific events such as click events to do the required operation.

 For example we might have a sign out link available in the website and our sole aim is to click the sign out link.

The way we can proceed is two:
1. It is simple record and playback approach and parameterise any data that has been making the sign out link dependent on the logged in user.
2. Just add the respective object in the repository file in coded ui testing it is the uimap file. Then call the event on that particular object that is sign out object.

Now suppose the added object is sign out link we will be having below outlined methodology.
Declare the object with its particular hierarchy order and then call event.

HtmlControl uiSignOutLink = this.UIMap.HierarchyWindow.HierarchyFrame.uiSgnOutlink; , new POint(0,0)); 

The above method signifies the syntax associated with the event.
The first parameter it takes is an object as has been declared in a line above and the second paramater it takes is a sort of syntax that needs to be cared for , do remain informed that the co-ordinates are no way deciding the object recognition, so it is immaterial whetehre we keep co-ordinates as 0,0 or some other as 56,67.

In the below screenshots, I have outlined some of the process to be followed to get the particular object added into the Uimap file that is the object repository file of the CodeduiTest project.

In the below sequence we will add an object using uitest control of the recording window.

Planning to add the tag of the blog : "Automation Testing On Share" into the uitest control map file .
So what I have just done is drag the cross hair which we use for inserting assertion points onto the psecific object by highlighting it as is shown below .
Now just open up the closed arrow sequence to get the object hierarchy established and understood by us and also find the options of adding the object into the Test Project's specific control map file.We can see the Add object button which we need to click and the object that has been in ticked status will be hence added to our control map file.

We can then find the message at the bottom that the object has been added successfully into the uimap file.

So guys whatever we have done till now has been in the IDE's buffer only, we need to store it into the uimap file and hence need to generate code for the object's addition into the uimap file for all our future access of the objects and perform relevant operations on the same. Hence we are needed to click Generate Code button.

The code is being generated now.

Okay so this is how we have learnt to add objects onto our object repository in the VSTS CodedUi Test Project automation tetsing.
I know this might just seem to be a bit complex in intial phase but once you can catch onto what has been outlined above, the usage can be really awesome and the code rework that we generally do in our automation script run during the regression suite execution can be made very easy.

A $25 tool has so much in offering I never could have thought of but the way this tool's utilisation has been encashed upon  by us in our team, I think the day is not far off , when the VSTS Test Projects might just be the most sought after automation tool in the industry .

For more on Automation Testing using CodedUitesting in VSTS :Log On To

Automation Testing Using Coded Ui Testing In VSTS

Post a Comment


Close Menu