José Dapena blog

Just another Igalia Blogs site

GtkNotebook and Dogtail

This week I’ve been hacking a while around Dogtail. It’s a Python library intended for implementation of functional tests of applications providing accessibility support through AT-SPI. It lets you check and manipulate the user interface from Python scripts, and it’s easy to integrate it into test cases.

While I was working, I found that I could not easily browse tabs in a GtkNotebook using dogtail. This issue has been reported in Gnome bugzilla (bug report). The problem is:

I’m not the only one that has detected the problem this way. Peter Johanson has sent two bugs and patches to solve the issue and add tab browsing support in Dogtail (report in Pyspi and report in Dogtail). In parallel I was developing similar patches. As Peter Johansons’ are more complete, I’ve simply added some functionalities this morning to the dogtail patch to provide an easier way to use the selection interface in Dogtail. I’ve uploaded the new patch to the Dogtail bug report.

Now you can simply write:

focus.application('gedit')
focus.widget(roleName='page tab', name='My tab')
focus.widget.node.select()

And it raises the desired tab easily. Hope those patches go upstream. I think they’re a good solution for the tab browsing issue.