Forum Discussion
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.
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
- 19 hours ago