Automating UI tests (was Re: Art of Unit Testing)

Alex Martelli aleaxit at
Sat Aug 18 09:27:30 CEST 2001

[posted to both comp.lang.python and the anygui list,
anygui-devel at, with followups to
the latter -- feel free to override if you think c.l.p needs
more discussion of this, of course]

"Joseph Andrew Knapka" <jknapka at> wrote in message
news:3B7D53EF.3A301516 at
> > I can't think of a reasonably complete solution that's worth the
> > effort for one user of a GUI toolkit -- the test-harness should,
> > it seems to me, be part of the GUI toolkit itself (alter sys.path
> > so a guitest directory is prepended, and rather than the actual
> > widgets &c what you're getting is some kind of test-harness
> > version).  But I don't know of any GUI kit, commercial or free,
> > for any language[s], that offers such a precious feature:-(.  It's
> > not easy to architect, of course:-(.
> Possibly the Anygui project could offer a backend that,
> rather than instantiating Tkinter or wxPython controls,
> or whatever, instead instantiates objects that present a
> programmatic interface for the use of unit test code.

Yes, I think that does make sense (for a _second_ release
of anygui -- better get a first one out first:-).  Maybe two
backends -- one which wraps any other real backend but as
a side effect also writes a log of anygui-level events, and
one that replays such events (and logs gui-related program
actions in textual form, for easier checking, rather than
drawing to the screen).  That's not exactly "programmatic
control", but it would give easy "capture & playback" test
ability to any anygui program, and finer-grained program
control would then be easier to build as an add-on (e.g.
by generating the logs to be replayed).


More information about the Python-list mailing list