Forum Discussion
Hi,
EkremMese1 wrote:I am curious about the opinions and experiences of yourself
Generally speaking, properly crafted Aliases (that must be used instead of NameMapping) are way more preferable and flexible approach in TestComplete world. The only exception is when one needs to create web tests that must be executed on web farm like BitBar.
But in real life, ineffective NameMapping (for example, that heavily relies on Extended Find which is turned on by default) may result in worse performance when compared to XPath.
Do you think using NameMapping.... for the WebElements instead of Aliases slows down the testing?
Because Aliases is more complicated for me, than NameMapping...
- rraghvani6 months agoChampion Level 3
How is Aliases more complicated than Name Mapping?
- AlexKaras6 months agoChampion Level 3
Hi,
EkremMese1 wrote:
using NameMapping [...] instead of Aliases
No, not instead.
It is recommended to use Aliases, but not NameMapping object.
Actually, NameMapping and Aliases are parts of one functionality.
Think of it this way:
-- On the lowest level it is your tested application with its hierarchy of GUI objects;
-- NameMapping is on the second level from the bottom and it defines how this or that GUI object can be found in the tested application;
-- Aliases are on the highest level. As you know, you can arrange Aliased objects in a way that is convenient for you. Internally, Aliased object references NameMapped object which, in its turn, references physical GUI object. This means, that if you create convenient tree of Aliased objects and your test code uses only them, then, if the hierarchy of GUI objects in your tested application changes (to certain reasonable extent), the only thing that you should adjust is NameMapping. You may add or remove intermediate objects in NameMapping or change search criteria, but this will leave your test code intact. Only NameMapping will be changed.
Alternatively, you may treat NameMapping and Aliases like virtual memory in Windows.
For virtual memory:
-- There are physical memory cells. They correspond to GUI objects in your tested application;
-- Then goes translation table that maps physical memory cells to virtual memory cells for every application running in the system. This corresponds to NameMapping;
-- Finally goes application's virtual address space, when application refers to some (virtual) memory cell and operating system, through mapping table, figures out what physical memory cell must be addressed. This corresponds to Aliases. When your test code references some Aliased object, TestComplete uses NameMapping to figure out what physical GUI object to address.
The essence here is not to rely on automatic NameMapping creation, but craft proper NameMapping and Aliasing manually and only then start to create or record actual test code.
Related Content
- 3 years ago
- 4 years ago
Recent Discussions
- 9 hours ago
- 7 days ago
- 10 days ago