[BangPypers] Using dogtail to test/automate gtk apps

Srijayanth Sridhar srijayanth at gmail.com
Wed Jul 29 09:07:08 CEST 2009


I am trying to use dogtail to make a demonstration about automating tests
for certain gtk applications we develop. I managed to get a fair bit of it
working but I am having a hard time getting dogtail to send events to
certain types of widgets, primarily the EventBox widget.

I've googled and not found anything significant. Has anyone worked on this?
I am pasting some code.

# This program draws a simple window with an event box in it. The
# eventbox is attached to the on_evbox_clicked() function and prints
# a simple message upon being clicked.

import pygtk
import atk
import gtk

def on_evbox_clicked(evbox,event):
        print "Simple click event"

evbox = gtk.EventBox()
evbox_acc = evbox.get_accessible()
evbox_acc.set_name("test event box")
window = gtk.Window()
window_acc = window.get_accessible()
window_acc.set_name("test window")

# end of eventbox.py


from dogtail.utils import run
from dogtail import tree
from os import environ,path,remove

evbox=app.child("test event box")
print evbox.actions

# actions are showing up as an empty dict. :(


So for some vague reason the eventbox has no actions associated with it.

Does anyone have a clue why this is so?

Thank you,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20090729/51cbedaf/attachment.htm>

More information about the BangPypers mailing list