[Tkinter-discuss] GUI testing

Guilherme Polo ggpolo at gmail.com
Thu Nov 13 16:19:20 CET 2008

On Thu, Nov 13, 2008 at 1:07 PM, Allen Taylor
<Allen.Taylor at mdacorporation.com> wrote:
> Guilherme,
> So, what is ttk, and how does it relate to Tkinter?

ttk is the short for Tk Themed widget set. It got included into tk8.5,
before it was just tile.
The relation to Tkinter is that it uses Tk widgets, just like Tkinter,
except they are different widgets to some extent, or completely new
widgets. But more important, the way you can test them is very much
the same.

> The app I have inherited
> is specifically Tkinter+Pmw. I want to make as few changes to it as possible
> in order to test drive it with test scripts.

The link I gave you tests the ttk widgets in the python wrapper, but
it contains some common "patterns" that you could apply to test any tk

> Things like waiting for windows
> to appear, pressing buttons, selecting items in list boxes, extracting
> values, etc., all from a script.

I do that there.

What I'm trying to say is that there is some common code in those
tests I did that you could use to do yours. You won't be able to get
them then change some lines and test all your code (just if your code
happens to be very similar to what I'm testing there -- nearly
impossible). But you can look at it and understand how the kind of
things you are after are done. I don't remember documenting it too
well, so some parts could look weird but they are all necessary to run
the tests correctly under windows and linux at least (it is very
likely that are other specials cases for macosx which are not there,
but I can't test for it).

> Dogtail looked like just the ticket until I
> found out that Tk apps don't talk AT-SPI. Switching the app to use GTK is
> not an option.
> A bit more web searching yielded another possibility
> (see http://mail.gnome.org/archives/gnome-accessibility-devel/2006-December/msg00029.html).
> I just touched base with Daniel Drake (the originator of the referenced
> thread) and he still suggests using Papi
> (http://ocemp.sourceforge.net/papi.html), which allows a non-GTK app to be
> AT-SPI-aware (albeit via ATK) . Perhaps I can hook something into Tkinter.

I'm not much into this subject of accessibility for testing software,
but I would like to hear more about it if you do something towards it.

> Seems like a lot of work though.
> Allen

-- Guilherme H. Polo Goncalves

More information about the Tkinter-discuss mailing list