Unit testing a GUI has always been something that scares me, and scares other people too. Because of this there are about a gazillion tools that behave in different ways, for example in Python, just have a look at: http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy#GUITestingTools (Since the whole world is obsessed with Web Applications, and this is becoming perversely true even in Python circles, some of these GUI Testing tools are actually web testing tools, but never mind that.) How do I do it? Well, we may talk in another blog about one of those tools, the awesome hack that is kiwi.ui.test but it is slightly restrictive on what you want to do, and how you should do it. Specifically, it needs you to have every widget named (which is fine when testing Glade-created interfaces, but a pain when hand-building them). Enter this one function that I found in the kiwi source. Kiwi is LGPL (whatever that means, but you should read the license if you are going to use it). import time i...