Forum Discussion

lingling_chiang's avatar
lingling_chiang
Contributor
5 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 ? Do...
  • tristaanogre's avatar
    5 years ago

    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.

  • tristaanogre's avatar
    tristaanogre
    5 years ago

    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.

  • hkim5's avatar
    hkim5
    5 years ago

    Hi,

    Salesforce does have alot of panels, and it some cases it really is the 'elbow grease' method to go in and find a unique id string. Another option (even though it seems as you are pretty far into this test suite) is to start a new project while mapping the object manually (https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/add/from-gui.html). You would just go into the application first and use the map object button on the objects that you anticipate that you'd interact with. That would guarantee that you have a unique static path (without tons of panel panel panels, since you can just map your final panel to a stable parent). Alot of work, but guarantees results.

    Also, love seeing the cucmberstudio integration!!  :)