Solved
Forum Discussion
rraghvani
Champion Level 3
2 years agoYou might be over complicating things here.
The Name Mapping repository stores all the objects of your tested applications. This is then used to instruct TC on how to locate the object in your app. It's assumed that these objects exists, and you have various methods that can be used to check their existence.
If you call e.g. NameMapping.Sys.browser.pageCssButtons.buttonCssButton, TC will verify each object i.e. browser, pageCssButtons and buttonCssButton exists based on the property values given.
Name Mapping can not be used as a "variable", it's used internally by TC.
Assuming object NameMapping.Sys.browser.pageCssButtons exists, you can check if the object button exists e.g.
var btn = NameMapping.Sys.browser.pageCssButtons.WaitNamedChild("buttonCssButton", 3000);
if (btn.Exists) {
// Performs testing actions over button
// ...
} else {
}