cancel
Showing results for 
Search instead for 
Did you mean: 

Unique Object Identifier

SOLVED
Highlighted
Contributor

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?

 

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Hero

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Community Hero

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Staff

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/...). 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!!  🙂 

Best,
Justin Kim

View solution in original post

8 REPLIES 8
Highlighted
Community Hero

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
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.

Highlighted
Community Hero

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Staff

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/...). 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!!  🙂 

Best,
Justin Kim

View solution in original post

Highlighted
Contributor

Hi,

 

We have been manually mapping the objects. Although the object browser is showing a deep level of panels but in the mapped objects, you can see we are trying to have the unique static path but it is hard  to do so as I  can't even find a unique combination to set the unique path, so sometime I have to use to wild card in order to achieve which is not recommended. Especially the page is overlay by many modals that make it harder to map.

I have discussed with the development team to add the idstr so that with the object type + idstr, will help to nail down the object. 

 

Do you recommend to enable Self-Healing mode?

 

What is cucumberstudio?

 

 

Highlighted
Community Hero

It sounds to me like you have the option "Use Extended Find when possible" checked under Tools -> Options -> Engines -> NameMapping.  As a general rule, I turn that option off so that mapping objects always includes the full hierarchy.  This doesn't mean you CAN'T use extended find, it's just not applied automatically,  You can then edit and adjust your hierarchy as you desire.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Contributor

I did turn on the extended find as the path is not robust. I have remap the objects a few times now as the project is still on-going updating. Once the development team add the idstr, that will definitely help to create a more robust namemapping. 

Highlighted
Staff

@lingling_chiang 

Even though you enable self-healing mode, it won't actually actively modify the namemapping of your project - thats because we dont want TC to actively change something permanently when we may have intended for it to be such a way. It will only make it so that your test is able to run through to the end using the "similar" objects to what you have mapped previously. 

On a separate note, you may not have cucumber studio! I just saw within your attached pictures the BDD scenarios icon - and I just assumed you had a Hiptest (now called cucumberstudio) account/project bound to it. cucumber studio is the rebranded hiptest- where you can collaborate and start your BDD tests.

Best,
Justin Kim
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors