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?
Solved! Go to Solution.
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.
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.
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!! 🙂
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.
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.
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.
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!! 🙂
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?
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.
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.
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.
Subject | Author | Latest Post |
---|---|---|