Ask a Question

Question Around Name Mapping

SOLVED
gdave
Regular Contributor

Question Around Name Mapping

Hi

 

The name of the item appearing on screen is 'Show Document' which is a MenuItem however in the Object Browser it is named as MenuItem(0). Now, after mapping the item I had changed the of MenuItem(0) to its actual on screen name which is 'Show Document' however my test failed. I have attached the screenashot of the reason from test log.

 

Is there a way I can sort this out and ensure that the on screen name is mapped to the MenuItem(0) in a way that it gets identified correctly ?

12 REPLIES 12
tristaanogre
Esteemed Contributor

The "Name" property is not "Show Document".  That is the text that appears on screen, but it is not the "Name" property of the object itself.  Technically speaking, you shouldn't be using Name to identify an object.

 

Prior to making your edits, were there errors or something happening in your test that prompted the need to change it?  Perhaps we can find a better way of solving your problem.


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
gdave
Regular Contributor

No there weren't any errors as such however what prompted me to take this action was, that elsewhere within our system there are multiple objects which are named as MenuItem(0) so in order for me to make identification easire I thought I'll change the name. Thanks

tristaanogre
Esteemed Contributor

That's what Aliases are for. 🙂  So, rename the Alias for the object to be what you want.  There's no need to change the mapping criteria.  


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
gdave
Regular Contributor

I guess that's what I did then. Please see the screen shot attached.

tristaanogre
Esteemed Contributor

Edit the mapping.  You have the Alias correct as "Show_Documents" but you don't need the "Name" property in your criteria.  Remove that property, it has no impact on the Alias.


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
gdave
Regular Contributor

It worked! Thanks


@tristaanogrewrote:

Edit the mapping.  You have the Alias correct as "Show_Documents" but you don't need the "Name" property in your criteria.  Remove that property, it has no impact on the Alias.


 

gdave
Regular Contributor

While the previous test worked, I bumped into another issue which may or may not be related to name mapping.

 

In Object Browser, the main menuitem name is MenuItem('Action') while the submenus under it are listed as menuitem(0), menuitem(1) and so on. The OnScreen name of the main menu is 'Action' and menuitem(0) is 'Refresh' & menuitem(1) is 'Change Adviser'

 

I had renamed the Alias menuitem(1) to Change_Adviser however, now, when I run my test I would expect a Click on main menu Action followed by sub menu Change Adviser but while executing the test I get a pop up message from TC "Unable to find the object that matches the "Change_Adviser" item, and then it gives me 2 options ie: Point to 'Change_Adviser' on screen & Edit the identification properties of 'Change_Adviser'. If I select first option of pointing on screen, the test fails with following reason ..... There was attempt to perform a action on a zero sized wondow........"The window size is (0, 0); the screen rectangle: the left top corner is (0, 0), the right bottom corner is (0, 0). Tested object: A. Editing the property too has no success.

 

I am not sure what's wrong here, would you be able to suggest anything ? Screenshot attached for more details. Thanks

tristaanogre
Esteemed Contributor

IF the secondary menu does not appear until you click on the first, you can't easily just point at the menu or find it on screen.  Instead of the drag-the-target method for finding objects in these situations, there's an option for SHIFT-CTRL-A... you select that, take your mouse to where you want it, click what you need, and then enter that keystroke to capture the highlighted 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
gdave
Regular Contributor

I would prefer that option but when I use CTRL+Shift+A, I get a different aliases altogether and when I right click on that alias and select option 'Show in Object Browser' it gives me an error message that "unable to highlight alias object in object browser panel, as it does not exist". Therefore, I am trying to use the object which exist in object browser rather than going CTRL+Shift+A route.

cancel
Showing results for 
Search instead for 
Did you mean: