script to automate GUI application (newbie)

B

bogdan romocea

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
 
G

Grig Gheorghiu

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
 
J

Jim

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
 
C

Cameron Laird

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top