TruthVoyager's avatar
TruthVoyager
New Contributor
7 years ago
Status:
New Idea

Handling Reoccurring Objects (like navigation links)

It would save a lot of time in maintainance if there were a way to link identical objects that happen to be on different pages to one master object.

 

Sort of like with templates but this controls the values. In other words, you may have several identical save buttons that would all inheret identification properties from one source. When the identificaton properties of the source are changed, so are all of the identification properties of the linked objects.

 

This way if the identification properties of the save buttons were to change, we would not have to update every mapped save button one at a time, we could instead update them all at once by changing the source. 

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    You can do this already in a way.  One of the things you can do with property values in NameMapping is indicate that the property value is set based upon a Project variable.  So, when you change the variable value, it updates the property value automatically in your NameMapping at runtime.

     

    See https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/basic-mapping-criteria.html#adding-identification-properties

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    You can set the variable up as having a "default value" that you can just set and forget.  You would only need to update that value as you need to when the application changes.  

  • tristaanogre While recording, will TC check project variables and, if an identification propety matches a project vairable, automatically set that mapped object to refrence the project variable? Or is this something that would need to be done manually?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Well, it's not that it sets the OBJECT to reference the variable.  The variable populates the mapping criteria.  

    Say, for example, you want to map the page object but you may change server boxes or root URL.  You can tell it to use the variable to replace the URL so that, rather than hardcoding the URL in your mapping criteria, it references the variable.

    If you update the variable in code, you will need to use RefreshMappingInfo on your browser object to clear the cache of objects but, once you do so, the new value will be used as mapping criteria.