Ask a Question

Two Object with Identical Names

Regular Contributor

Two Object with Identical Names

Hi all

I am really struggling with this and I was hoping if anyone can help me to sort this out.


Basically there are two objects which share the same name. One listed under menu Transaction-OneOff-Withdrawal & other as Transaction-Regular-Withdrawal. Though the object 'Withdrawal' share the same name both are categorized under different sub-menus (screenshot below)



I have mapped them in name mapping with their unique name & properties:

'Withdrawal' object listed under sub-menu item called one-off


'Withdrawal' object listed under sub-menu item 'regular


Now when I run my test it works fine and successfully clicks the 'Withdrawal' object listed under sub-menu item 'One-Off'. However, my test fails when it tries to find the second 'Withdrawal' object which is listed under sub-menu item 'Regular'. And interestingly below is the failure reason. My first issues is that both the objects are under the same parent object so how is it possible that TestComplete can find the same parent for object1 but unable to find the parent for object2


Secondly when I click on 'Intelligent Fix' in the hope to fix this, it seems that TestComplete points to the very first 'withdrawal' object listed under sub-menu item 'one-off'. And it suggest me to update the new values for the properties which apparently belongs to the first 'withdrawal' object.



Any help to fix this problem is much appreciated.



Champion Level 3



It is my guess that GUID part for namePropStr and href NameMapping parameters is not stable and changes its value for each test run.

What I would do is to locate some parent that contains the menu item that you need to use and then, search for menu item not from page, but from this parent.

Sample pseudocode:

var page = ... ;
var oneOffContainer =[...].oneOffContainer;
// or
// page.FindChild(...); // search criteria for One-Off menu container

var withdrawalItem = oneOffContainer.FindChild('contentText', 'Withdrawal', 50);

var regularContainer =[...].regularContainer;
// or
// page.FindChild(...); // search criteria for Regular menu container

var regularItem = regularContainer.FindChild('contentText', 'Withdrawal', 50);



  /Alex [Community Champion]
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
SmartBear Alumni (Retired)

Thanks a lot, Alex and Marsha!

@gdave does this help?

Sonya Mihaljova
Community and Education Specialist

Regular Contributor

Hi Alex


Thanks for your reply. Sorry I couldn't reply any sooner as I was away.


Mine are based on keyword test, do you think if there is any way to sort it using keyword test ?



Regular Contributor


I have replied back to Alex. Cheers

Showing results for 
Search instead for 
Did you mean: