Micro Focus QTP (UFT) Forums
How to identify the properties of amenu item(not Weblist)oncethe menu tab is clicked? - 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: How to identify the properties of amenu item(not Weblist)oncethe menu tab is clicked? (/Thread-How-to-identify-the-properties-of-amenu-item-not-Weblist-oncethe-menu-tab-is-clicked)



How to identify the properties of amenu item(not Weblist)oncethe menu tab is clicked? - raval - 09-29-2012

Hello ,
I'm looking for some insights on how to identify the properties and their values for each Item from the tabbed menu .{Note the menu is displayed when clicked on the tab and displays as long as the mouse cursor hovers on it}

I was able to write a code to hover over the menu tab (which is in a webtable) but unable to capture the Items from the drop down menu once the tab is clicked upon ..Let me know .
my code is given below.
Code:
Set oParent = Browser("name:=C Home").Page("title:=C Home")
                oParent.Highlight


                            Set oWtbl = Description.Create()
                            oWtbl("micclass").Value ="WebTable"
                            Set VarParentpath =  oParent.ChildObjects(oWtbl)
                            CountVar =  VarParentpath.Count()
                            'Msgbox CountVar


                            For i = 1 to CountVar-1

  sWtbl_name = VarParentpath(i).GetRoProperty("name")
  sColNums =  VarParentpath(i).GetRoProperty("cols")
    sRows = VarParentpath(i).GetRoProperty("rows")

If  Trim(sWtbl_name) = "tsks"  And  Trim(sColNums) = "11"  And Trim(sRows) ="1" Then

                                            

                                               For icols = 1 to sColNums

                                                            Set oWtblImg =Description.Create()
                                                                oWtblImg("micclass").Value = "Image"
                                                                    Set VarImgpath =  oParent.ChildObjects(oWtblImg)
                                                                            CountImg  = VarImgpath.Count()
                                                                            'Msgbox CountImg
                                                                            VarImgpath( icols).Highlight
                                                                            sfilename = VarImgpath( icols).GetRoProperty("file name")
                                                                            sname = VarImgpath( icols).GetRoProperty("name")
                                                                            'VarImgpath( icols).Click
'At the is point below the mouseover works perfectly on the tab where i see th elist of items from the pop down menu
'My question is how do I enhance the code to click on the menu item once mouseover action is done , because im unable to capture the properties of the menu item as they dissappear once the mouse pointer is removed? Even a Object Spy does not help as the i cannot hover over the tab .
Code:
VarImgpath( icols).FireEvent"OnMouseover"
                                                                            'Msgbox sfilename
                                                                            'Msgbox sname
                                                    


                                       Next

'Exit For
   End If
                    

                        Next
A response will be sincerely appreciated. Thank you and have a good day !!


RE: - jcraig26 - 10-02-2012

Did you try using the FireEven Method?

Something using:
Code:
Browser("aaa").Page("bbb").WebElement("text:=Link Name").FireEven "onmouseover"

At least to help get the properties of the hidden items.

Just a quick thought off the top of my head.