alinder
15 years agoContributor
Using MappedName inconvenient with multiple Aliases for the same object
There are times when it has been sensible in my application under test to create more than one alias to represent an object in my Name Mapping, such as a button that has been implemented as a single control can sensibly be abstracted as different test objects, for example Aliases.Foo.btnNext and Aliases.Foo.btnFinish . The Aliases feature supports this and has the conceptual strength to be used this way.
However, if I need to independently reference the object, such as identifying it with the Find method on MappedName or to note it for logging, I can't rely upon this abstraction as MappedName only makes the shortest alias accessible. If I understand it right, Aliases.Foo.btnFinish.MappedName returns "Aliases.Foo.btnNext".
In certain circumstances, using WaitAliasChild can suffice, but overall, I find the limitations of the MappedName property constrain how I can use the strength of the Name Mapping feature.
However, if I need to independently reference the object, such as identifying it with the Find method on MappedName or to note it for logging, I can't rely upon this abstraction as MappedName only makes the shortest alias accessible. If I understand it right, Aliases.Foo.btnFinish.MappedName returns "Aliases.Foo.btnNext".
In certain circumstances, using WaitAliasChild can suffice, but overall, I find the limitations of the MappedName property constrain how I can use the strength of the Name Mapping feature.