Re: dogtail-devel Question on dogtail and kpdf



On Sat, 2006-07-29 at 09:59 -0400, indhu krishna sivaramakrishnan wrote:
> Hi,
> 
> I am a graduate student trying to use dogtail as a GUI benchmarking
> tool.
Excellent!

Bear in mind when doing timing tests that dogtail automatically adds
delays in order to avoid race conditions.  There's some discussion of
this in Len's article here:
http://www.redhat.com/magazine/021jul06/features/dogtail/
(see "searchBackoffDuration", "debugSleep" and "actionDelay", for
instance).  This is configurable, so you should be able to eliminate it
for your purposes.

> I tried out the example python script with gedit and it works fine.
> But when I try to run it for kpdf, it does not work. Is there a
> different class for kpdf? 
Unfortunately, I believe Qt does not yet support ATK, and thus will be
invisible to tools such as Dogtail.  I believe there are plans to fix
this in Qt v4, but I've no idea right now how far advanced these are, or
if they're still planned.  If anyone has more information on this,
please let the list know.  Alternatively, perhaps Qt's accessibility
infrastructure has advanced; maybe we can rig something up if it has
Python bindings?

Dogtail should work fine with GTK, with recent versions of OpenOffice,
and with some versions of Firefox/Mozilla/Thunderbird etc.  It won't
work with older toolkits like Motif which don't have ATK support.  So
you'll have to choose applications built using the appropriate toolkits
to get this to work.

It's usually best to use Dogtail's "sniff" tool to see what Dogtail can
see (or perhaps smell?)

> Is there any place where the classes are documented?
Try the URL above, and also:
http://people.redhat.com/zcerza/dogtail/doc/index.html

> 
> I am just trying to open a pdf document. The folliwng code justs opens
> the kpdf viewer but does not recognize the rest of the commands. I
> have pasted the code here: 
> 
> #!/usr/bin/env python
> # Dogtail demo script using tree.py
> # FIXME: Use TC.
> __author__ = 'Zack Cerza <zcerza redhat com' 
> 
> from dogtail import tree
> from dogtail.utils import run
> from time import sleep
> from os import environ, path, remove
> environ['LANG']='en_US.UTF-8'
> 
> # Start kpdf.
> run("kpdf")
Yes, this doesn't need ATK to run, so would successfully open kpdf
> 
> # Get a handle to kpdf's application object.
> kpdf = tree.root.application('kpdf')
This point onwards would fail, as you're seeing.
> 
> # Get a handle to kpdf's File menu.
> filemenu = kpdf.menu('File')
> 
> # Get a handle to kpdf's Save button.
> openbutton = kpdf.button('Open') 
> 
> # Click the button
> openbutton.click()
> 
> Can someone please help me on this? 
For what it's worth, the script as written looks good; it probably would
work if Qt had ATK support.  So you may want to try either GTK apps or a
recent OpenOffice to continue.

Hope the above helps.
Dave




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]