-
Junior Member
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
-
Contributing Member
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
-
Contributing Member
Re: Menu Items
Hi Sudhan_Otsuka,
Is this a web application? Please let me know.
Regards,
Ganesh
-
Junior Member
Re: Menu Items
Yeah..it is web based appliaction(.NET).
-
Expert Member
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.
-
Expert Member
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
-
Contributing Member
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
-
Forum Rules