SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Guest

    Getting contents of PopupMenu

    I am attempting to right click on an object within a window, and I am looking to verify the contents of the PopupList that appears.

    I have been having no luck in doing this, and was wondering if anyone has any bright ideas as to how I could manage this

  2. #2
    Guest

    Re: Getting contents of PopupMenu

    I've appended a code snippet that may be helpful to you. I use this method for verifying the correct contents, item count, enabled, and checked states of popup menus in listview and treeview controls.

    The example code is for a popup menu that appears when clicking an item in a listView, so the click location information that is used to resolve the popup menu's tag comes from the location of the list item clicked.

    For your particular application, you'll need to determine the appropriate click location and set the Point to it, which will resolve the tag for your popup menu.

    ------------------

    Tony Mrozinski
    Sr. Software Test Automation Engineer
    Home Networking Operations
    Intel Corporation

  3. #3
    Guest

    Re: Getting contents of PopupMenu

    I am unable to get this to work.

    The popuplists are the same as doing a right-click on a file in explorer.

    The listviews, treeviews do not apply to the application being tested, all I want is the contents to verify.

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting contents of PopupMenu

    I't been my experience that popups are dynamic and typically belong to the mainwin - not to the initiating 'button' or dialog that might contain them.

    You might try defining a Popup child within the MainWin, then printing the results of a your_mainwin.Popup.GetChildren() to verify that you can see the menu items.

    John

  5. #5
    Junior Member
    Join Date
    Jul 2000
    Location
    Chicago
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting contents of PopupMenu

    Here is another way!
    You need to modify this to click on anything you want.

    [ ] LIST OF STRING lsItems
    [ ] BrowserPage.Click (2, 200, 200) //You need to modify this
    [ ] lsItems = BrowserPage.PopupMenu("").GetContents ()
    [ ]
    [ ] ListPrint (lsItems)

    And now, you can use this the way you want to verify the contents.


  6. #6
    Guest

    Re: Getting contents of PopupMenu

    Cheers Samy,

    However, the problem I'm now getting is that the GetContents function is returning nothing. I can see that this should be working, but I'm perplexed as to why all of the values in the list are not being returned.


    Any help appreciated.

  7. #7
    Junior Member
    Join Date
    Jul 2000
    Location
    Chicago
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting contents of PopupMenu

    Try to do a manual "Window Identifier" on the PopupMenu and see what it comes up with and change the "BrowserPage.PopupMenu("").GetContents ()" accordingly.

    Hope this helps!

  8. #8
    mg
    mg is offline
    Junior Member
    Join Date
    Aug 2000
    Location
    santa clara, ca, usa
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting contents of PopupMenu

    How to select an item from a second popup menu which comes up by selecting a menu item from the first popup menu? The following code works but picks up a different item each time, when placed inside a loop:

    ExploringC.ContentsOfC.RightMenu.SendTo.MenuItem(" #2").Pick()

    I tried MenuItem("My Briefcase"), but that does not work.

  9. #9
    Junior Member
    Join Date
    Jul 2000
    Location
    Chicago
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting contents of PopupMenu

    my 2c...

    Try using MenuSelect () or PopupSelect () on the specified object, like
    Window.Object.MenuSelect (5, 5, "#{iItemOfFirstPopUp}/#{iItemOfSecondPopUp}"

    Good Luck!

  10. #10
    Guest

    Re: Getting contents of PopupMenu

    This is how we test the contents and right-click popup menus. We have a method that returns the WINDOW name of the popup menu dynamically after it has be displayed. Then we use the name to access the popup menu. It is not the best method, but it works for the limited places where we need to test these menus.

    // method for some class or window
    // return the window for the popup menu
    window GetPopupWindowName()
    RECT rPos = this.GetItemRect(this.GetSelText ( ))
    this.Click(2, rPos.xPos, rPos.yPos)
    return this.PopupMenu("$PopupMenu/({rPos.xPos},{rPos.yPos})")

    // use the method with VerifyProperties
    wMainWin.TreeView1.GetPopupWindowName().VerifyProp erties({...})
    ""
    {}
    {...}
    {'MenuItem("#1|Copy")', {...}}
    {"Checked",FALSE}
    {"Enabled",TRUE}
    {'MenuItem("#2|Paste")', {...}}
    {"Checked",FALSE}
    {"Enabled",TRUE}

    Note that the method could be modified so that the click location is speciied as an argument.

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:20 PM.

Copyright BetaSoft Inc.