Forum Discussion

lingling_chiang's avatar
lingling_chiang
Contributor
6 years ago
Solved

Unique Object Identifier

Our web development is running on Salesforce.

I have problem uniquely identify object that make mapping objects difficult. Is there recommended industrial standard of uniquely identified object ? Does the salesforce has a way to auto generate the unique identifier? Which property fields to be used and what is the standard naming convention?

 

 

8 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Naming convention of the objects is up to you.  But it is generally a good idea to pick some sort of conventional rule that will make sure that a) the object is uniquely named and b) it's clear what the object represents.  Things like "Panel44" don't really say what it is.  But "panelCustomerServiceDropdown" is much clearer as to what hte panel contains and represents.

     

    Generally speaking, for MOST applications, ObjectType + idStr or something similar is usually sufficient.  But each application is differnt and will have different objects and properties and such that will be available to identify the object.  You'll need to do some investigation on your own to find the best combination of properties to uniquely identify objects.

    • lingling_chiang's avatar
      lingling_chiang
      Contributor

      I have attached the screen shot of our application, the object browser tree to give you the context.

       What is the de facto approaches or practices for the web application? Do we provide every object type a unique idstr? it will be lot of work as you can see the level of panels are quite deep down the tree.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Best practice, as always, is to not "keep" what is mapped automatically by TestComplete when doing recording or mapping of objects but to spend the time modifying the mapped objects to include the proper unique identifiers and properties.  From the screenshot, I see ObjectType is TextBox.  So, that's one property I'd keep when editing the NameMapping for the object.  I'd then include the idStr as that seems to be the best bet at an additional property for a unique identifier.  The combination of those two and the relational hierarchy should be sufficient to identify your object.

         

        Beyond that... this is elbow grease stuff... If you haven't been monitoring and modifying your NameMapping as you go, then you will have to go back and update items.  Now, looking at the Alias in that screenshot, it seems obvious that not ALL the objects in the hierarchy are mapped, probably because Extended Find is probably on by default.

         

        So... it comes down to you needing to do work to make sure your NameMapping is sufficiently robust.  That seems to be the answer to your question....  that is, unless you have a specific problem you're trying to solve.