Forum Discussion
The URL is identical except for an id which gets created at runtime. The page which loads however includes text which uniquely identifies a specific page and that’s what we are using as a “Required Child”. Then I map other objects for a specific page in the MappedObjects. The issue is the object under the page does not account for the parent page as criteria to recognize the child object. It may find it on some other page having the matching properties for that node only. This lead us to our post asking “Required Parent with a mapped object”. Is there a way?
You can build a string that is the whole path of the required child, starting with the parent page, then adding in the id, then adding the desired object name on the end. Then use eval(MyString) as the object to search for. That will give you the specific object on the specific page.
- kmorillo6 years agoOccasional Contributor
Marsha,
We appreciate the suggestions how to rememdy via a script. The orginal question was if we could do it via name mapping.
Can we do it via mapping or do we have to script? If via mapping, how is that done?
- Marsha_R6 years agoChampion Level 3
You can't "require" anything in a name mapping. It's a tree construct that shows how your objects relate to each other.
If you have objects that have similar names in the mapping, then you can use the Alias feature as I mentioned before to give them unique names and use those names in your test instead of the mapped names.
If you don't want to use Aliases, then you can construct the specific name each time as I suggested and then you will access exactly that object and not a similar one on another page.