Forum Discussion
I also stopped to use NameMapping. I replaced the name mapping by a custom solution with the "Find"- method. If you write your method in a clever way you can also use something like a conditional mode and everything else. I hab the same problem. On one testcase I get all elements from the Gui and then I make some interactions with them. It's much easier without name mapping
Hi,
The final decision for every case depends on the tested application.
Assuming that the tested application was created with the testability in mind (and this is less than often nowadays), then, usually, the bast approach is a combination of Aliases and .FindXXX(). The peculiarity here is that Aliases must be carefully created in advance, but not automatically during recording. This approach usually provides best balance of code maintainability and performance.
Pure Aliasing usually can be implemented for simple static applications only.
Pure .FindXXX() approach might lack performance and be less visually clear, but, depending on the tested application, it may be the only way of controls' identification, unfortunately.
- tristaanogre7 years agoEsteemed Contributor
That's why we run a blend of the two... A large part of our AUT is static so Mapping the objects ahead of time takes less code and, therefore, less code maintenance. It gives us better performance (less interpretive code to execute and less overhead in the "find" logic) and gives us the added benefit of cached object identities. However, there are some dynamic portions to our applications so, in those cases, we use the "Find" methods on a parent object that is, itself, mapped... best of both worlds.
Related Content
- 4 months ago
- 6 years ago
Recent Discussions
- 11 hours ago
- 2 days ago