Micro Focus QTP (UFT) Forums
duplicate menu names on different menu levels - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: duplicate menu names on different menu levels (/Thread-duplicate-menu-names-on-different-menu-levels)



duplicate menu names on different menu levels - jove1776 - 10-27-2011

I have a menu structure which is giving me some problems.

The menu is 4 layers deep. I am trying to navigate to the 4th layer in the menu. Normally I navigate the menu by identifying the innertext of the menu item. However in this particular scenario I cannot correctly identify the 3rd level menu item as there is also a menu item on the 2nd level which has identical properties.

the menu is as follows:

ordering->picking->special->picking

I can successfull get to click on the menu option special, but after that i get an error saying: The "Dynarch_menu" object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object. (presumably now as there are 2 picking menu options on the screen)

the code for the menu is as follows:

Code:
Public function DynarchMenuOption(Dynarch_object, menu_item)

    Dim itemsfound
    itemsfound = split(menu_item,":")
    
    For itemidx = 0 to ubound(itemsfound)
        itemnow = itemsfound(itemidx)
        If  itemidx  = 0 Then
            htmltag = "DIV"
            else
            htmltag = "TD"
        End If
        Dynarch_object.SetTOProperty "innertext",itemnow
        Dynarch_object.SetTOProperty "html tag",htmltag        
        Dynarch_object.Click
    Next    
End Function

I was calling the function as follows:

Code:
DynarchMenuOption Browser("Browser").Page("Page").WebElement("Dynarch_menu"), "ordering:picking:special:picking"

What is the easiest way to click on this 4th layer menu option ?


RE: duplicate menu names on different menu levels - ravi.gajul - 10-27-2011

Hi,

Try .childobjects() on the third menu(special) and click.
Please let us know if you have found something else

Regards,
Ravi