script to automate GUI application (newbie)

Discussion in 'Python' started by bogdan romocea, Jan 18, 2005.

  1. Dear Python experts,

    I have a GUI application (Windows; apparently written in Java) which I
    want to use through a script (without a mouse or keyboard). First, one
    of several buttons needs to be clicked (no keyboard shortcuts
    available, but I can measure the coordinates in pixels from the top
    left corner of the window to the center of the button to be clicked).
    Then, a window with a few drop-down lists pops up - I have to make some
    choices and click OK (it's possible to navigate from one drop-down to
    the next with Tab, and hit Enter for OK).

    I want to run the script above from code (if this then click "... and
    OK") and perhaps by means of several desktop shortcuts (one shortcut
    for each set of GUI inputs).

    Is such a script possible? If yes, how do I get there? I searched
    comp.lang.python but didn't find something directly applicable (or so
    it seemed to me - I'm a beginner). Directions (and sample code, if
    possible) will be warmly appreciated.

    Thank you,
    b.






    __________________________________
    Do you Yahoo!?
    Yahoo! Mail - Easier than ever with enhanced search. Learn more.
    http://info.mail.yahoo.com/mail_250
     
    bogdan romocea, Jan 18, 2005
    #1
    1. Advertising

  2. Bogdan,

    If your app is written in Java, take a look at Marathon
    (http://marathonman.sourceforge.net/). It uses Jython as its scripting
    language and it's pretty smart about how it does automation (i.e. it
    doesn't look at screen coordinates, but at control names). It also
    offers a capture/replay functionality, and it automatically builds the
    Jython script that drives your flow of actions. You can then edit and
    enhance the script manually.

    Grig

    bogdan romocea wrote:
    > Dear Python experts,
    >
    > I have a GUI application (Windows; apparently written in Java) which

    I
    > want to use through a script (without a mouse or keyboard). First,

    one
    > of several buttons needs to be clicked (no keyboard shortcuts
    > available, but I can measure the coordinates in pixels from the top
    > left corner of the window to the center of the button to be clicked).
    > Then, a window with a few drop-down lists pops up - I have to make

    some
    > choices and click OK (it's possible to navigate from one drop-down to
    > the next with Tab, and hit Enter for OK).
    >
    > I want to run the script above from code (if this then click "... and
    > OK") and perhaps by means of several desktop shortcuts (one shortcut
    > for each set of GUI inputs).
    >
    > Is such a script possible? If yes, how do I get there? I searched
    > comp.lang.python but didn't find something directly applicable (or so
    > it seemed to me - I'm a beginner). Directions (and sample code, if
    > possible) will be warmly appreciated.
    >
    > Thank you,
    > b.
    >
    >
    >
    >
    >
    >
    > __________________________________
    > Do you Yahoo!?
    > Yahoo! Mail - Easier than ever with enhanced search. Learn more.
    > http://info.mail.yahoo.com/mail_250
     
    Grig Gheorghiu, Jan 18, 2005
    #2
    1. Advertising

  3. bogdan romocea

    Jim Guest

    It sounds like a case for the Expect program, to me. Try Google-ing
    for "Expect". If you are looking for a Python approach, then try
    googling for "Expect Python".

    Jim
     
    Jim, Jan 18, 2005
    #3
  4. In article <>,
    Jim <> wrote:
    >
    >It sounds like a case for the Expect program, to me. Try Google-ing
    >for "Expect". If you are looking for a Python approach, then try
    >googling for "Expect Python".
    >
    >Jim
    >


    No--that is, I find his description unambiguous in NOT allowing
    for "keyboard control", which is Expect's domain. Expect, of
    any flavor, will not help.

    Along with the Java-savvy solutions already mentioned, several
    general-purpose record-playback tools are available for Windows.
    <URL: http://wiki.tcl.tk/8813 > mentions several.
     
    Cameron Laird, Jan 18, 2005
    #4
  5. bogdan romocea

    McBooCzech Guest

    Try following scripting language to automating Windows GUI, it
    simulates keystrokes (supports most keyboard layouts), simulates mouse
    movements and clicks and does tons of other stuff:
    http://www.hiddensoft.com/autoit3/

    It works nicely for me.
     
    McBooCzech, Jan 19, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Wehner
    Replies:
    0
    Views:
    1,827
    Michael Wehner
    May 21, 2006
  2. Tim Golden
    Replies:
    2
    Views:
    255
  3. Kenneth McDonald
    Replies:
    3
    Views:
    889
    Stef Mientki
    Apr 24, 2008
  4. Tester in ruby
    Replies:
    1
    Views:
    237
    Dave Burt
    Oct 14, 2005
  5. perlperl

    automate command line script using perl

    perlperl, Jun 15, 2006, in forum: Perl Misc
    Replies:
    6
    Views:
    361
    perlperl
    Jun 16, 2006
Loading...

Share This Page