Results 1 to 7 of 7

Thread: Menu Items

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Answers
    12

    Menu Items

    Hi Friends,

    I need to count and find out the names of items in menu, for example on a web page tool bar menu there is a menu link "Admin".When we click on Admin link it shows Add,Modify,Delete items on that menu.I need to count them and get the names.

    I really appreciate your help!

    Thanks,
    Mahi


  2. #2
    Contributing Member
    Join Date
    Feb 2007
    Answers
    61

    Re: Menu Items

    Record & see whether QTP is recognising the menu as Table, If yes then u can get the Row count & names from the table


  3. #3
    Contributing Member
    Join Date
    Feb 2007
    Answers
    48

    Re: Menu Items

    Hi Sudhan_Otsuka,

    Is this a web application? Please let me know.

    Regards,
    Ganesh


  4. #4
    Junior Member
    Join Date
    Feb 2007
    Answers
    12

    Re: Menu Items

    Yeah..it is web based appliaction(.NET).


  5. #5
    Expert Member
    Join Date
    Apr 2007
    Answers
    147

    Re: Menu Items

    Try out with this...
    Browser(BrowserName).Page(PageName).WebList(ListName).GetROProperty("all items")
    * But use it only if you find this property "all items" when you spy it.


  6. #6
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    Re: Menu Items

    You will get your answer by this example:

    this example is "To comapre the list box item with another list box item"

    Window("Flight Reservation").activate
    SelItem=Window("Flight Reservation").WinComboBox("Fly From:").GetROProperty("text")
    msgbox SelItem 'displays the selected item in the list
    LisItem=Window("Flight Reservation").WinComboBox("Fly To:").GetContent
    msgbox LisItem 'displays all items in the list
    Itemcount=window("Flight Reservation").WinComboBox("Fly To:").GetItemsCount
    msgbox Itemcount 'displays the no of items in the list
    For i=0 to Itemcount -1
    a = window("Flight Reservation").WinComboBox("Fly To:").GetItem(i)
    'msgbox a
    If SelItem=a Then
    msgbox "Items Are Matching"
    else msgbox "Items Are Not Matching"
    End If
    Next


  7. #7
    Contributing Member
    Join Date
    Nov 2007
    Answers
    48

    Re: Menu Items

    Hi Sudhan,

    you can do this by using following lines of code

    ItemCount = Window("window_name").WinMenu("Menu").GetItemProperty("MenuName", "SubMenuCount")
    msgbox ItemCount



    Cheers

    CPS


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact