[BangPypers] Using dogtail to test/automate gtk apps

Nagappan Alagappan nagappan at gmail.com
Wed Jul 29 14:27:37 CEST 2009


Hello Jayanth,

Did you get a chance to try the same with LDTP [1] ? Its being used by GNOME
automation project [2], Ubuntu, VMware, Palm Source.

[1] - http://ldtp.freedesktop.org
[2] - http://mago.ubuntu.com

Thanks
Nagappan

On Wed, Jul 29, 2009 at 12:07 AM, Srijayanth Sridhar
<srijayanth at gmail.com>wrote:

> Hello,
>
> 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
> pygtk.require('2.0')
> import atk
> import gtk
>
> def on_evbox_clicked(evbox,event):
>         print "Simple click event"
>
> evbox = gtk.EventBox()
> evbox.connect("button-release-event",on_evbox_clicked)
> evbox_acc = evbox.get_accessible()
> evbox_acc.set_name("test event box")
> window = gtk.Window()
> window.add(evbox)
> window.connect("delete-event",gtk.main_quit)
> window_acc = window.get_accessible()
> window_acc.set_name("test window")
> window_acc.set_role(atk.ROLE_WINDOW)
> window.show_all()
> gtk.main()
>
> # end of eventbox.py
>
> --------------------------------------------
>
> from dogtail.utils import run
> from dogtail import tree
> from os import environ,path,remove
>
> app=tree.root.application('eventbox.py')
> 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,
>
> Jayanth
>
>
>
>
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
>


-- 
Linux Desktop (GUI Application) Testing Project -
http://ldtp.freedesktop.org
http://nagappanal.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20090729/fbb4c09a/attachment.htm>


More information about the BangPypers mailing list