Forum Discussion
In addition to what shankar_r says, let me add what has been said many times here concerning NameMapping. If your Alias string contains panels and objects that you never interact with directly, then you're doing it wrong. Aliases are supposed to be used to be able to make the mapping more consumable and readable for scripts. For example, you have
Aliases.browser.pageAccudeltaPortal.panelPortalApp.sectionFeatInternalUser.modalUploadFile.panelModalDialog.formFormHorizontal.panelFormGroup2.panelColSm9.panelSingledatepicker.panel.panelSingledatepickerinput.panelDaypickerDaypickerHorizonta.panel.panelDaypickernavigationDaypicke.vg
This probably reflects, exactly, object by object what you find as
NameMapping.Sys.browser.pageAccudeltaPortal.panelPortalApp.sectionFeatInternalUser.modalUploadFile.panelModalDialog.formFormHorizontal.panelFormGroup2.panelColSm9.panelSingledatepicker.panel.panelSingledatepickerinput.panelDaypickerDaypickerHorizonta.panel.panelDaypickernavigationDaypicke.vg
The NameMapping tree can stay as it is... but you can telescope your aliases down to something more manageable. You would know best what that is. However, as I mention above, if you are not actually interacting with a panel or form or object ever in your tests, then you don't need it in the Aliases. So, I would suggest editing your alias down to something more like
Aliases.browser.pageAccudeltaPortal.modalUploadFile.panelSingledatepicker.panelDaypickernavigationDaypicke.vg
Just as a rough guess mind you. As long as your NameMapping stays the same, this Alias, once edited to this point, will function just as before.
For more on editing Aliases, see
Hi,
I tried what you mentioned but I cannot seem to get it to work. In order to get to the element I am trying to interact with don't I need to specify the full path? In the example you gave above it fails because it looks for
Aliases.browser.pageAccudeltaPortal.modalUploadFile
when the actual path is
Aliases.browser.pageAccudeltaPortal.panelPortalApp.sectionFeatInternalUser.modalUploadFile
I get the error:
Unable to find the object modalUploadFile. See Additional Information for details.
Would I need to delete entire layers of my name mapping in order to telescope the Aliases?
- tristaanogre9 years agoEsteemed Contributor
You cannot use the collapsed alias without actually collapsing the Alias in your NameMapping editor. check out the links I posted for how to do this. You can edit the Aliases to a shortened version while preserving the full path in NameMapping... that's what Aliases are for. So, the NameMapping would have the full path... but your Alias would represent that full path in a shortened form.
- tristaanogre9 years agoEsteemed Contributor
You also might want to take a look at the Editing Aliases video on this page.
https://support.smartbear.com/testcomplete/videos/