Ask a Question

Same idStr Name different links

Reece
Occasional Contributor

Same idStr Name different links

Using a web app there is a Nav Menu that has 2 sub-menu items with the same name on the web page and the same idStr observed in the Object Browser.

 

So running the recorded test, the incorrect sub-menu is being clicked. 

I would like to know if there is a work around to access these two links other than using the idStr.

5 REPLIES 5
tristaanogre
Esteemed Contributor

What other properties are available for those submenu items?  I'm assuming they have a different caption, label, or some other text.  What I would do is, instead of using the idStr, combine the ObjectType with that unique caption to identify the object.


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
AlexKaras
Community Hero

Hi,

 

As a side note and addendum to Robert's suggestion, I think that this is a good reason to ask Development is it intentional that two different items have the same ids or something that should be corrected.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Reece
Occasional Contributor

I checked and only one has an ID, the Inner text is what is common to both. Not sure why the one without an ID is being given that ID

Reece
Occasional Contributor

I am some what new to this software and still in the process of learning so I'm not entirely sure how to combine the object type with another property.

Hi,

 

>  how to combine the object type with another property.

http://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/manag... (from http://support.smartbear.com/testcomplete/docs/testing-with/object-identification/index.html help section) may help.

Also https://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/ (from https://support.smartbear.com/screencasts/testcomplete/) is really worth watching.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: