Forum Discussion
tristaanogre
15 years agoEsteemed Contributor
That is what NameMapping was designed for. :-)
However, there are features of NameMapping that make it even easier. There's Conditional Mode, Required Children, and Extended Find. Depending upon what exactly it is I'm doing, I may use a combination of all three of these within a single project. You can also use wildcards in NameMapping to handle some of the more dynamic aspects of the page.
There are times, though, when NameMapping doesn't do it completely for me. I still use it to create Aliases for pages and root components that I know aren't going to change that frequently. But then I may need to find within those components additional components that may be a lot more variable and dynamic. In those cases, rather than spending the time trying to figure out how to map them, I use FindChild or FindAllChildren.
There's a great webinar screencast posted at http://smartbear.com/support/screencasts/testcomplete/reliable-tests-for-dynamic-objects/ that covers a lot of this.
Hope this gives you some direction to work in.
However, there are features of NameMapping that make it even easier. There's Conditional Mode, Required Children, and Extended Find. Depending upon what exactly it is I'm doing, I may use a combination of all three of these within a single project. You can also use wildcards in NameMapping to handle some of the more dynamic aspects of the page.
There are times, though, when NameMapping doesn't do it completely for me. I still use it to create Aliases for pages and root components that I know aren't going to change that frequently. But then I may need to find within those components additional components that may be a lot more variable and dynamic. In those cases, rather than spending the time trying to figure out how to map them, I use FindChild or FindAllChildren.
There's a great webinar screencast posted at http://smartbear.com/support/screencasts/testcomplete/reliable-tests-for-dynamic-objects/ that covers a lot of this.
Hope this gives you some direction to work in.