Ask a Question

Add object button recognized as the same add object button from another different page

OV
Frequent Contributor

Add object button recognized as the same add object button from another different page

Hi,

 

In my script i'm moving from one page to another, in the 1st page i'm adding devices by selecting the object and then click a + sign that open a drop down list in which i select from a value. then i move to a different page - programming and again select an object ,click the + sign in order to select a value. my problem is that tc recognize this + sign menu in these two different pages as the same menu although it is 2 different menus with different number of values and different values. tc won't recognized the different and i won't be able to select a value by its name, probably it's possible to select a value by index but i want to be able to select value by its name.

 

Does anyone know why the + sign recognized as the same object?

 

Thx

12 REPLIES 12
tristaanogre
Esteemed Contributor

Sounds like a mapping issue again.... that the identifying factors you're using for the one control matches the other control.  If they are two different controls, then they should be mapped differently.  There is some identifying factor that is missing that keeps them distinct.  Spend the time examining the two controls in the object browser and add the appropriate distinguishing properties to your mapping to make them distinct in your code.


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
OV
Frequent Contributor

Hi Robert,

 

Thank you.

 

"add the appropriate distinguishing properties to your mapping to make them distinct"

 

I some more explanation about "Ambiguous recognition of the tested object", I had this issue in the past and solved it but to be honest i fall into that again and try to add a unique property value but it doesn't work. what if there's no unique property to identify the object in 100%? should i ask our developers to create one? not sure what to do in this case.

 

Thx

tristaanogre
Esteemed Contributor

Identifying an object may not be a single unique property... but a combination.  There may be more than one property where the combination of them creates a unique identification.  This is what I was implying, that you would add an additional property to your existing list of properties that would distinguish the two objects.  

 

If, however, you cannot find such a thing, then yes, go to your developers and see if there's something that they can do to help you more clearly identify the objects.


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
OV
Frequent Contributor

I must say that when i have this kind of a case i'm going to the Edit Name Mapping Item dialog for the specific item and try to see what property could be unique to this object and then i select to move it to the Selected side. is that what i should do? does tc search for the properties showed in the Selected side? does it look for the object matching those properties. 

I'm asking this question because there were few times that i tried to move properties to the Selected side and to see if tc change behavior and it didn't, then i said lets pass all the properties to the selected side and see if that will solve the problem... it didn't so, i was thinking to myself if so many properties combination won't help tc recognize this object in 100% than what will.

 

Don't know if i'm doing the right think to uniquely recognize the object by a unique property.

 

If that's the right way i'll be happy to hear but if that's not the way i would be happy to hear how to do that

 

Thanks

tristaanogre
Esteemed Contributor

What I would do, actually, is investigate the object you want in Object Browser or Object Spy FIRST, without going through NameMapping.  The reason being is that, if you're having recognition problems to begin with, the NameMapping interface will find what it THINKS is the right one but still could be the wrong one.

 

The way I would handle your particular situation is investigate BOTH objects, get a comparison of the properties between the two (screenshot to screenshot) and see if you can determine a set of properties that will distinguish them.  THEN I would go to NameMapping and make the appropriate adjustments.


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
OV
Frequent Contributor

I found the two object that answer the same name in the Aliases , I've changed the name to one of them, that didn't help so, I did what you suggested and picked 2 properties that both have with two different values and added those values to one of the objects, that didn't help as well, should i add those two values to both of the objects? and should what i did suppose to be enough?

 

The values i've added are: Stretch, System.Windows.Controls.ItemsControl

 

Thanks

tristaanogre
Esteemed Contributor

Changeing the name doesn't change the identification.  The combination of the properties and the hierarchy of them in relation to parent objects is what determines object identification.  Without knowing the specifics of the properties, I can't tell you whether or not what you've suggested are sufficient.  You DO need to make the changes to both, not just to one.  They both need to have proper identification.

 

Please use Object Spy and generate screenshots of both objects in question and their entire property list.  Provide those and I can give you some suggestions.


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
OV
Frequent Contributor

Ok, The thing is that the 2nd object is a bit problematic because TC cannot see it's properties, etc. because it is not always displaying, in order for it to display we'll need to click the + sign then a menu item will display and this is the other object so the 2nd document is for the 2nd object. hope it can help or another option is that there could be another ItemsControl objects that i'm missing.

 

Pls see attached

 

Thx,

 

Ofer

tristaanogre
Esteemed Contributor

In order to help mapping with both objects, I need similar documentation of the object spy of the second object.  That's the only way to determine how to distinguish between the two.


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
cancel
Showing results for 
Search instead for 
Did you mean: