Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select Menu items
#2
Not Solved
Option 1:
You can use the xpath of the menu item and click on the item directly. Check the below snippet (used to click on the 'Support Matrix -> Windows Support Matrix" menu item.
Code:
Browser().Page().WebElement("xpath:=//ul[@id="primary"]//a[text()='Windows Support Matrix']").Click

Option 2:
You can use the mouse over on until you hit the last item and then click on the last menu item in the input. Below is the skeleton of code (did not got a chance to execute, so please modify the function as per need.)
Code:
Public Function SelectMenuItem(oPage,sMenuPath)
    'Make sure the path contains submenu items and path is mentioned correctly
    If instr(sMenuPath,"->")>0  Then
        aMenuItems = Split(sMenuPath,"->")
    End If
    'Loop through the menu items and click on the last item
    For iMenuItem = lbound(aMenuItems) to Ubound(aMenuItems)-1
        oPage.WebElement("xpath:=//a[text()='" & aMenuItems(iMenuItem) & "']").FireEvent "onmouseover"
    Next
    oPage.WebElement("xpath:=//a[text()='" & aMenuItems(ubound(aMenuItems)) & "']").Click
End Function

Let me know if you need any more help on this.
Thanks,
SUpputuri
Reply


Messages In This Thread
Select Menu items - by shilpaS - 06-18-2015, 05:10 PM
RE: Select Menu items - by supputuri - 06-19-2015, 01:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] [WPF] DataGrid: get items of ControlTemplate robertosalemi 0 3,297 07-14-2016, 07:52 PM
Last Post: robertosalemi
  SwfList: unchecked all items robertosalemi 0 1,854 12-21-2015, 03:46 PM
Last Post: robertosalemi
  Object Spy not detecting items in C ICL AndyBSG 5 4,011 11-28-2014, 09:32 PM
Last Post: AndyBSG
  to verify the presence of items in wpf application Priyanka2 0 2,280 10-10-2013, 03:52 PM
Last Post: Priyanka2
At MISSING MENU ITEMS IN QTP ahmet571 2 3,914 11-27-2012, 02:42 PM
Last Post: Prashant kandukuri

Forum Jump:


Users browsing this thread: 2 Guest(s)