SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Aug 1999
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Popup Menu problem

    Hi,
    Does anybody know if I want to use silk test to automate the test on popup menu (right mouse click and a menu pops up).
    How can I do it without providing the cooridnates?
    There is a method called PopupSelect but it requires the use of corridnates which is not useful in my case.
    Any help will be appreicated.
    Thanks

  2. #2
    AJ
    AJ is offline
    Moderator AJ's Avatar
    Join Date
    Jun 1999
    Location
    San Jose, CA
    Posts
    1,691
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Popup Menu problem

    Tried that many times.

    Not SilkTest nor any other tool can recognize that "action menu". Coordinates seems to be the only workaround. But there should always be another way to perform the same functionality in a product (Windows Standards). I usually log a bug if that i missing.


    ------------------
    AJ Alhait
    BetaSoft Inc.
    AJ Alhait
    BetaSoft Inc.

  3. #3
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Popup Menu problem

    The example in SilkTest 5.0 Online Help under PopupMenu Class is something you may want to try. It works sometimes. The problem I reported to Segue is when you use the Cursor.GetPosition () method together with this example, the x and y position returned is way off the item where the popup menu is supposed to be invoked (at least in a PowerBuilder app I am testing).

  4. #4
    Junior Member
    Join Date
    Dec 1999
    Location
    Pleasanton, CA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Popup Menu problem

    Yes, there is a way to use PopupSelect() without specifying mouse coordinates. Try the following, provided you are in a ListView or TreeView control.

    RECT rRect = listview.GetItemRect ("foobar.txt")
    window.PopupSelect (rRect.xPos, rRect.yPos, "Open")

    ------------------
    Wilbur Hsu
    QA Engineer II
    Documentum, Inc. (NASDAQ: DCTM)

  5. #5
    Senior Member
    Join Date
    Aug 1999
    Location
    San Diego, CA USA
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Popup Menu problem

    What kind of AUT is this? Browser, Java client, etc.? Might make a difference.

    My AUT is a Java client and it has popup menus in treeviews. I took the same approach as the previous reply and it works fine. I then extended the TreeView class to add a RightClickOnItem (sItemName) method which does the GetRect and Click commands.

  6. #6
    Junior Member
    Join Date
    Aug 2001
    Location
    Natick, Ma, USA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Popup Menu problem

    whsu's solution worked for me, thanks that one was driveing me insane!

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

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

    Re: Popup Menu problem

    I don't use the coordinate method at all for popups in Java applications, but then maybe my use of popups is a little different than standard. Popups (like flyby text) are dynamically created, mutually exclusive objects - only one can exist at a time. Silk's Record/WindowDeclarations doesn't see them but you can get at them with carefully placed GetChildren() calls.

    The solution I found is to manually create a Popup declaration and define all possible instances of popup menus and popup menuitems under that one declaration. You can then use the normal window.Popup.menuitem.Pick() syntax just like any other standard menu.

    To obtain the popup menu items, expose the popup manually, then run a short routine that does a listprint of GetChildren(). Initially you'll run this routine against the Mainwin to capture the Popup instance itself, then use that Popup declaration to obtain a ListPrint of its children. Write their equivalent declaration entries as children of the Popup declaration. (Note that you can easily massage this GetChildren list to obtain the class of each menuitem or even actually format the needed declarations directly to the results file.)

    John


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

 

 

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 11:04 PM.

Copyright BetaSoft Inc.