[Tutor] Automating GUI Command Regression Testing

Alan Gauld alan.gauld at btinternet.com
Tue Jun 17 23:58:43 CEST 2008


"Gordon Agress" <gordon.agress at gmail.com> wrote
> help me learn to pipe keyboard input for commands to a Tkinter GUI, 
> and then
> to automate saving a screen shot of the resulting GUI display?  Is 
> this even
> possible?

Its possible but not trivial.
It depends a lot on your OS since X Wndows and MS Windows work
very differently. And if you are on Aqua under MacOS your best bet
might be to use Applescript to automate things.

> to supplant manual entry of keyboard commands (hotkeys like Alt-F, 
> tabs and
> arrows to move among fields and buttons, data entry, 'enter', etc) 
> with a
> file holding all that stuff, and store an image of the outcome for 
> later
> review or comparison.

If you are on Windows then you can use the FindWindow and PostMessage
API calls to send windows events to the window. You can find the API
documentation in the python winall documentaton and the native C
documentation on the MS MSDN werb site.

See also the recent thread (this last week) about moving a window 
using
the Win32 API for a very short example...

If you are on X wuindows then it is much more complex and you might
be better lookingh for a 3rd party tool. There are several commercial 
ones
and there might be some freeware ones too, but I don't know the
area well enough to recommend anything. If you have money to spend
I can get some recommendations from my test team if needed...

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list