Forum Discussion
tristaanogre
15 years agoEsteemed Contributor
In my current incarnation of a software automator, I've been using the NameMapping more often than not because the application I'm working with has much more predictable, static pages. There's not going to be much chance that different elements will appear on the same pages with different values in this environment.
Previously, though, working with an eCommerce web application, the main store page could have any number of different "identical" components but they would be a different set depending upon the category of products displayed... always the same page, but a different listing. So, in that case, I'd map the Page and a couple of "static" components but then use methods like FindChild, FindAllChildren, etc, to search out the specific objects/items that I'd need for the test I was running. Because the test itself was data driven, combined with a data driven web page, I needed that flexibility that if the data in the test said "Select 5 of Item X", I'd be able to find Item X on the page and enter a quantity of 5 in the text box corresponding to that item.
So... I guess that would be a good rule of thumb to use in determining when to use NameMapping and when not to... Data Driven tests combined with a Data Driven web applications means less reliance on NameMapping and more reliance on dynamic code-driven object identification. A lesser degree of Data Driven means a greater ability to rely on NameMapping. A greater degree of Data Driven means a greater reliance on code-driven "FindChild".
Previously, though, working with an eCommerce web application, the main store page could have any number of different "identical" components but they would be a different set depending upon the category of products displayed... always the same page, but a different listing. So, in that case, I'd map the Page and a couple of "static" components but then use methods like FindChild, FindAllChildren, etc, to search out the specific objects/items that I'd need for the test I was running. Because the test itself was data driven, combined with a data driven web page, I needed that flexibility that if the data in the test said "Select 5 of Item X", I'd be able to find Item X on the page and enter a quantity of 5 in the text box corresponding to that item.
So... I guess that would be a good rule of thumb to use in determining when to use NameMapping and when not to... Data Driven tests combined with a Data Driven web applications means less reliance on NameMapping and more reliance on dynamic code-driven object identification. A lesser degree of Data Driven means a greater ability to rely on NameMapping. A greater degree of Data Driven means a greater reliance on code-driven "FindChild".