SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Aug 2001
    Location
    california
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What\'s the best approach???

    I have a menubar in my AUT that SilkTest recognizes as a RadioList. When I verify the contents of the of the RadioList, it properly recognizes the items. Now, my problem is invoking the menu. Although, I have a workaround which is to use hotkeys (e.g.ALT-F) to invoke the menu. The other problem I have is how do I capture the menu items. Actually, the good thing is the menu items are actually recognized by SilkTest as menu items. It's just a matter of how do I capture it?

    Here's what I had attempted to do but unfortunately failed...
    I initially planned to create some sort of SelectMenu method that will look something like this. Obviously, it won't work since lsString is a string and not seen as an object.

    where MainMenu is a radiolist.

    [-] SelectMenu(ANYTYPE aMenu)
    [-] LIST OF STRING lsString = MenuBar.MainMenu.GetContents()
    [ ]
    [-] select
    [-] case (aMenu==File)
    [ ] MenuBar.MainMenu.lsString[1].Select() //select File Menu
    [-] case (aMenu==Edit)
    [ ] MenuBar.MainMenu.lsString[2].Select() //select Edit Menu
    [-] case (aMenu==Format)
    [ ] MenuBar.MainMenu.lsString[3].Select () //select Format Menu
    [-] case (aMenu==Help)
    [ ] MenuBar.MainMenu.lsString[4].Select () //select Help menu

    Anyway, does anyone have any idea on what the best approach will be? Thanks for your time and would appreciate any suggestions you might have.

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

  2. #2
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What\'s the best approach???

    what do you mean by capture the menu items? Have they been declared? You say that SilkTest recognizes the menu items as menu items. Can you then use the Pick() method to select your menu items. In your select method that you are creating, can you use the @ operator to select them? i.e. MenuBar.MainMenu.@lsString[1].Select()

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  3. #3
    Junior Member
    Join Date
    Aug 2001
    Location
    california
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What\'s the best approach???

    Thanks for the reply.

    What I meant when I said SilkTest could capture the menu items is that, when I record the window identifier it shows something like this
    DialogBox("Application").PopupMenu("").MenuItem("O pen|$23526")

    Just to add, the submenu items come up as a popup menu when the main menu item is selected.

    What I want to do is run some tests on the menu items like get contents, which items are enabled, etc.

    I tried your suggestion on
    MenuBar.MainMenu.@lsString[2].Select()
    but it's giving me an error "Type mismatch - Field name should be a string" What must I be doing wrong? Thanks.



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


    [This message has been edited by beya (edited 02-01-2002).]

  4. #4
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What\'s the best approach???

    so it's a popup menu. I would suggest you read the online help for the PopupMenu class. It gives pretty good instructions on how to deal with popup menus. I've used this for my right mouse click popup menus and seems to work pretty well. I haven't used it in your situation where a menu bar is seen as a radio list and the menu's are seen as popup menus. Hope this helps.

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  5. #5
    Junior Member
    Join Date
    Aug 2001
    Location
    california
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What\'s the best approach???

    Thanks for the help though.

    I was wondering since I am able to invoke the menu using hotkey, now my problem is how to keep the menu open while I do my verification since what happens the menu closes and when I am about to do the verification the menu is no longer available. I have tried sleep that didn't work. Any ideas. Thanks.

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

  6. #6
    Junior Member
    Join Date
    Aug 2001
    Location
    california
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What\'s the best approach???

    i just figured out why
    MenuBar.MainMenu.@lsString[2].Select() is returning an error.

    It should be
    MenuBar.MainMenu.@(lsString[2]).Select()

    I was able to get as far as invoking the context menu but my problem is when I tried to get the contents by doing this.

    MenuBar.MainMenu.@(lsString[1]).GetContents()

    I got an error that Control is not responding. It makes sense to me in a way since the selection I am making is not actually a control per se.

    Hmm... still haven't figured out how I am going to get the menu items.

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

  7. #7
    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: What\'s the best approach???

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by beya:
    What I want to do is run some tests on the menu items like get contents, which items are enabled, etc.

    <HR></BLOCKQUOTE>

    Sounds like you are trying to record a testcase or an action then hitting Ctrl-Alt hoping to see that Verify Window, right? You have probably figured out by now that you can't even record Window Declarations for Popup Menus...
    That doesn't work well on Popup Menus (see online help for other ways).
    Popup Menu items are usually pre-defined meaning you know exactly what items will popup when you do Right Click. The states of some items may change to enable/disable or check/uncheck. So you do not have to keep checking the contents of the Popup Menu over and over. I have not seen popup menu items that are constantly changing (growing/shrinking in number) all the time, at least in my experience.

    For example:
    If you want to check whether a popup menu item is enabled, select the item then verify the result of your selection (did it invoke a new dialog? or did it generate an error? or did it do nothing?). If a new dialog comes up, then you know the popup menu item is enabled.

    Hope this helps!




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

  8. #8
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What\'s the best approach???

    you can try setting the following agent option before doing the select:

    Agent.SetOption(OPT_VERIFY_RESPONDING, FALSE)

    or wrapping the code in a do\except

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

 

 

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 07:28 PM.

Copyright BetaSoft Inc.