Forum Discussion
Thank you
Hi,
> Is it a good and safe idea?
Silver bullet does not exist and every solution is usually a result of several trade-offs and is located somewhere in the middle between extreme conditions.
Full name of the object is its full absolute name :) and corresponds to this exact physical control. If/when developers change control type, its location within objects hierarchy or its identification properties you will have to update your test code appropriately.
NameMapping is (among other useful things) a translation table that makes it possible to create a logical name to be used in test code and bind this logical name to the physical one. So, you will need to adjust only NameMapping when something changes for the mapped control. Test code stays unmodified.
Aliasing is the next level of NameMapping abstraction. Aliases refer to NameMapping (and through it to physical controls) and make it possible for you to organize controls tree for your tests in a way that is more logical and convenient for test code from end-user and tester point of view.
Summary:
-- Use of Full Names only will result in a hardly maintainable code;
-- By creating wrapping functions that return objects by their Full Name you will (less efficiently) duplicate NameMapping functionality;
-- Usually, the best approach is to create a reasonably small basic NameMapping tree and map skeleton elements of your tested applications UI. Then, using these skeleton elements as search roots, use .FindXXX() methods to search for dynamic elements that are either difficult or not worth to NameMap (e.g. table cells, drop-downs, etc.)
- habhoub7 years agoOccasional Contributor
Thank you, Got it :)
so it's better to keep working on Name Mapping but to be careful how to update it correctly.
Actually, some team members are using the full names of the objects, others still using aliases..
Related Content
- 2 years ago
- 10 years ago
- 7 years ago
Recent Discussions
- 4 days ago
- 4 days ago