cancel
Showing results for 
Search instead for 
Did you mean: 

Two diffrents objects with same name in Mappingtable

SOLVED
Highlighted
Contributor

Two diffrents objects with same name in Mappingtable

Hi,

I have massive problem with my project.

 

There is two Combobox in my form, but that saved in Mapping as on name. So, when I run my test, TC can recognize just a Objects and Clicked twice on first-object.

 

Please look at Pic.

0.JPG

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Hero

Re: Two diffrents objects with same name in Mappingtable

Most likely the problem is that your criteria for mapping the objects is not unique enough.  So, both objects match the mapping criteria you have defined so both objects are shown as mapped to the same item in your Mapped Items tree.  

 

This happens frequently with allowing TestComplete to automatically map objects without doing any review of said objects.  Two things to keep in mind when mapping objects.

 

1) Objects are mapped based upon who their "parent" is

2) Objects are mapped based upon the set of property/value pairs.

 

So, if your mapping tree has the objects having the same parent and the same property/value pairs.  You'll have this conflct.  

 

Some tips:

 

1) Go to Tools -> Options -> Engines -> NameMapping and turn OFF the object to use extended find whenever possible.  Extended find is a good feature but, if over used, you'll end up with a parent hierarchy that is too general and you end up with this problem.

2) After recording a test, go back and look at what was mapped and make any adjustments on propery/value pairs.  Look for values that change dynamically with each test run and modify those appropriately or even remove them and replace them with other properties.

3) Use more than one property/value pair to map an object.  The more properties you can include to distinguish one object from another, the better.  For example, in your case, it's possible that it's simply using the "class" property... two objects, same class, same parent... same mapping


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

Re: Two diffrents objects with same name in Mappingtable

You're in Aliases.... you can't drag an Alias to a parent that is not a parent in the Mapped Objects.  There is another "tree" above the one you're manipulating that is the Mapped Objects tree.  That's where you do your main NameMapping editing and manipulating.  Aliases are used to take a Mapped Object and give it a structure and Name that is more useful in coding.

See https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/abou...


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

12 REPLIES 12
Highlighted
Community Leader

Re: Two diffrents objects with same name in Mappingtable

Have you tried this ?

 

https://support.smartbear.com/viewarticle/65804/

 

 

Un sourire et ça repart

Highlighted
Contributor

Re: Two diffrents objects with same name in Mappingtable

Thanks, I test it, but it's not working

Highlighted
Community Hero

Re: Two diffrents objects with same name in Mappingtable

Most likely the problem is that your criteria for mapping the objects is not unique enough.  So, both objects match the mapping criteria you have defined so both objects are shown as mapped to the same item in your Mapped Items tree.  

 

This happens frequently with allowing TestComplete to automatically map objects without doing any review of said objects.  Two things to keep in mind when mapping objects.

 

1) Objects are mapped based upon who their "parent" is

2) Objects are mapped based upon the set of property/value pairs.

 

So, if your mapping tree has the objects having the same parent and the same property/value pairs.  You'll have this conflct.  

 

Some tips:

 

1) Go to Tools -> Options -> Engines -> NameMapping and turn OFF the object to use extended find whenever possible.  Extended find is a good feature but, if over used, you'll end up with a parent hierarchy that is too general and you end up with this problem.

2) After recording a test, go back and look at what was mapped and make any adjustments on propery/value pairs.  Look for values that change dynamically with each test run and modify those appropriately or even remove them and replace them with other properties.

3) Use more than one property/value pair to map an object.  The more properties you can include to distinguish one object from another, the better.  For example, in your case, it's possible that it's simply using the "class" property... two objects, same class, same parent... same mapping


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

Re: Two diffrents objects with same name in Mappingtable

Again Hi,

 

she Save it with diffrent name but when she run the Test, she allways clicked on first Combobox. 😞

Highlighted
Community Hero

Re: Two diffrents objects with same name in Mappingtable

I'm not sure you understood... it's not about saving it with a different name.  The mapped name is not what determines what box is clicked on.  You need to edit the NameMapping itself.

 

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/add/...


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

Re: Two diffrents objects with same name in Mappingtable

Thank you so much that's working

Highlighted
Contributor

Re: Two diffrents objects with same name in Mappingtable

I have a qustion,

 

sometimes the TC recognise falsch parent for a object. How can I change the parent of Objects.

Highlighted
Community Hero

Re: Two diffrents objects with same name in Mappingtable

Click and Drag within the Mapped Objects tree and that will change the parent.  And it's most likely not a "false parent" but, because of the Extended Find feature being on, might be an effect of the unedited auto-mapping.  


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

Re: Two diffrents objects with same name in Mappingtable

I try it but not working :-(, look to pick

 

 

 

1.JPG

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

Compare images using the Region Checkpoint

See replies!

Converting UTC TimeDate in an Excel file

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