Forum Discussion
I'm studying the help/tutorial link you provided. I was trying to rename the object as you suggested but I don't think I'm in the right place. Is this the right place to assign 'Aliases.Screen.Date_From' ? If I modify the object name, TC no longer can find it.
No.
If you go into the NameMapping element of your project, you should see three panels.
On the right, is the large main panel showing the details of whatever object you have selected.
Beside it, to the left, are two smaller panels. One is "Mapped Objects", the other "Aliases. Drag mapped objects here".
The "Mapped Objects" parts is the full object map. It NEEDS to be complete and contain all the elements required to locate objects within your application.
The "Alias" part however, is up to you. By default, I think it mirrors any mapped objects into the Alias map at the same time. You don't need this. You can delete elemets from the Alias map (container panels and so on) and just leave the key components. You can also rename them on the object tree or in the detail panel for them.
Be ceareful if you delete objects from the Alias map as it will ask if you also want to delete them from the object map. Make sure you don't accidentally delete hapf your application and end up re-mapping it all!
It's worth getting your head round and using it well as it makes understanding mapped object references in your code much easier. Ditto maintaining your object map. If the Alias map is clear and simple, and something breaks due to a change, sort the object map and, if you've done it well, the Aliases (and thus all your tests that use them) will sort themselves.
- VFixed10 years agoContributor
Thank you! I think I found where to update... is this right?
- VFixed10 years agoContributor
I think I did it...? And the test even ran successfully.... I hate to sound so shocked but if I did it right then I'm the happiest newbie ever.
- Colin_McCrae10 years agoCommunity Hero
On renaming the object ..... no. Thats an identification property. My bad there. Think you may have to double click it open, then edit the Alias name in the full object details. Or just F2 it like in Windows Explorer in the Alias object tree. (But it looks as though you may have already figured that out as the object names look right in the test run ...)
But you've got the jist of it.
There is probablty a lot in the Alias tree that I would remove. Depends how integral they are to the look and feel of a page. If they are invisible container panels and layers which are little more than graphics overlays, I don't bother with those in the Alias map. Only in the full object map. You can cut out unwanted layers in the Alias map. Condenses all the object references up nicely and makes them much easier to relate to onscreen objects. If they are obvious "sections" within a page, them you maybe do want them there. Hard to say without seeing it. But I think it should read like the screen looks to the user.
If the test is working, then good stuff.
One thing I would recommend, is I note you are using SetText to populate a value in a field, then TAB to exit it - using Keys. Tabbing out is good. Will usually activate exit trigger event etc. I'm not such a fan of SetText. You're using a native method of the control to populate it directly. Thats not what a user does. They key in. Keys is much more realistic. Depending how they validate the field, you may miss bugs. If a field should be alpha only, but the validation is done on keypress, using SetText will miss that. If the validation on keypress has a bug in it, you'll miss it using SetText. You'll catch it using keys.
So, personally, Keys and Click (variants of) wherever possible in my tests.
Always do what the user would do. Native methods are a last resort. (At least, when doing tests to represent user/GUI interactivity. I guess they are handy for less UAT type testing.)
(I'm also not so familiar with keyword testing. I 100% script. So if anyone wishes to correct any of the above, feel free to do so!)