Two Object with Identical Names
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.
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.
var page = ... ; var oneOffContainer = Aliases.browser.page.[...].oneOffContainer; // or // page.FindChild(...); // search criteria for One-Off menu container oneOffContainer.Click(); var withdrawalItem = oneOffContainer.FindChild('contentText', 'Withdrawal', 50); withdrawalItem.Click(); ... var regularContainer = Aliases.browser.page.[...].regularContainer; // or // page.FindChild(...); // search criteria for Regular menu container regularContainer.Click(); var regularItem = regularContainer.FindChild('contentText', 'Withdrawal', 50); regularItem.Click();
/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.
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 ?