Results 1 to 5 of 5
  1. #1

    Using Java Menus with Robot

    Hi All,

    I have 2 years experience with SILK Test (HTML ASP environment) but am very new to Robot (1 day).
    I am trying to use Robot to click a Java Menu on our app using the MenuSelect method but it does not seem to like it.
    I have set the Java Extension Manager option but can not think of anything else.
    I am beginning to think the method MenuSelect does not work with Java apps - Y/N.
    Is there any other include/extension files I need to reference or anything like that.

  2. #2
    Advanced Member tonymro's Avatar
    Join Date
    Jul 1999
    Deep in the Coast Range Mountains of Oregon, USA

    Re: Using Java Menus with Robot


    Indeed, MenuSelect will not work for Java Menus, as Rational treats most Java objects as special case items. If you look in the SQABasic Language Reference, you'll find the JavaMenu user action command for interacting with JavaMenus.

    Example: JavaMenu MakeSelection, "Type=JavaMenu;Name=Swing menus;Path=Choosers->Color Chooser", ""

    The more I work with Robot, the more I miss Silk's OO 4Test language.

    Sr. Software Test Automation Architect

  3. #3

    Re: Using Java Menus with Robot

    Think I have to agree with you Tony. I am missing SILK as well and when I was using it i would have never thought that possible.

  4. #4

    Re: Using Java Menus with Robot

    What Robot version and Java Enabler version do you use?

    I presume Color Chooser is a sub-menu of Choosers. A workaround that we found handy was to break the submenu selection into two. First, MakeSelection on the Choosers. Then insert another JavaMenu MakeSelection statement which clicks on Chooser->Color Chooser.

    Here is how we did it:

    JavaMenu MakeSelection, "Type=JavaMenu;Index=1;Path=Tools", ""
    JavaMenu MakeSelection, "Type=JavaMenu;Index=1;Path=Tools->Web Search", ""
    JavaMenu MakeSelection, "Type=JavaMenu;Index=1;Path=Tools->Web Search->New...", ""
    Sachin Lalye

  5. #5

    Re: Using Java Menus with Robot

    Originally posted by sachinus:
    Here is how we did it:

    JavaMenu MakeSelection, "Type=JavaMenu;Index=1;Path=Tools", ""
    JavaMenu MakeSelection, "Type=JavaMenu;Index=1;Path=Tools->Web Search", ""
    JavaMenu MakeSelection, "Type=JavaMenu;Index=1;Path=Tools->Web Search->New...", ""
    <font size="2" face="Verdana, Arial, Helvetica">Thanks, That worked perfect for me [img]images/icons/smile.gif[/img]

    Originally Robot was recording:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> JavaMenu MakeSelection, &quot;JavaCaption=Untitled;\;Type=JavaMenu;Index=1 ;Path=Tools&quot;, &quot;&quot;
    JavaMenu MakeSelection, &quot;JavaCaption=Untitled;\;Type=JavaMenu;Index=1 ;Path=Tools-&gt;Tool1&quot;, &quot;&quot;
    JavaMenu Click, &quot;Class=SunAwtWindow;Level=3;\;JavaCaption=Unt itled;\;Type=JavaMenu;Index=1;Path=Tools-&gt;Tool1-&gt;Tool1a&quot;, &quot;&quot; </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">That last "Click, "Class=SunAwtWindow" Wasn't occuring during playback. So that had to be replaced with the 'MakeSelection' like the first 2 and it worked perfect.

    [ 05-24-2004, 09:04 AM: Message edited by: DssTrainer ]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:53 PM.

Copyright BetaSoft Inc.