Forum Discussion

DarylMM's avatar
DarylMM
Occasional Contributor
7 years ago
Solved

Full String not being returned using DDT object

I am using a DDT object to import locators / data / keywords etc. from an Excel file. I am beginning to have an issue now with the name mapping string being too large and not is not being returned fully.

 

For example, in my file I have:

Aliases.browser.pageAccudeltaPortal.panelPortalApp.sectionFeatInternalUser.modalUploadFile.panelModalDialog.formFormHorizontal.panelFormGroup2.panelColSm9.panelSingledatepicker.panel.panelSingledatepickerinput.panelDaypickerDaypickerHorizonta.panel.panelDaypickernavigationDaypicke.vg

 

And when I import the locator I get this:

Aliases.browser.pageAccudeltaPortal.panelPortalApp.sectionFeatInternalUser.modalUploadFile.panelModalDialog.formFormHorizontal.panelFormGroup2.panelColSm9.panelSingledatepicker.panel.panelSingledatepickerinput.panelDaypickerDaypickerHorizonta.panel.panelD

 

Does anyone know why this is happening / how to solve the issue?

 

Thanks

  • 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 

     

    https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/overview.html

     

    https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/managing/hierarchy.html

     

     

5 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    Hi,

     

    Excel values will get fetch based on the first row value and also it determines the data type.

     

    So, In your case if the 1st row values is less then 255 then it will truncate all other row values to 255 characters.

     

    To resolve this issue you can do any of the below things,

    • Create a excel like i attached and then run against that

    (or)

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      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 

       

      https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/overview.html

       

      https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/managing/hierarchy.html

       

       

      • DarylMM's avatar
        DarylMM
        Occasional Contributor

        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?