How to use qatesttool

The upstream documentation is not perfect, so here is a short introduction 
about how to start using the the OOo qatesttool. :-)

The testtool project is part of the QA project, 
http://qa.openoffice.org/index.html. The qatesttool home page is at 
http://qa.openoffice.org/qatesttool/index.html

I think that the most useful documentation is in the document "Introduction to 
Automated GUI Testing" that can be found at 
http://qa.openoffice.org/qatesttool/OOo_testtool.pdf.

ooo-build includes some support for the qatestool, see
ooo-build/doc/test-ooo.txt for more details.


What do you need to start a test?

1. You need the testtool.bin. It is part of normal OOo build/installation. It 
is built in the module automation and installed as program/testtool.bin


2. You need a test. The complete set of tests can be download at
http://qa.openoffice.org/qatesttool/src680/tt_env_OOo_2.0.0.tar.gz

I suggest to get the actual version from the usual OOo cvs, though. It is in 
the module qa/qatesttool. I got it this way:

$# ooo-build/bin/tunnel
$# export CVSROOT=:pserver:pmladek@localhost:2401/cvs
$# cvs co qa/qatesttool


3. The testtool has to be configured. I suggest to start with
ooo-build/doc/testtoolrc.sample and install it as ~/.testtoolrc. It is because
the section [Crashreporter] is required but it cannot be created by the
testtool GUI. The section [OOoProgramDir] is required but cannot be easily
created by GUI. Once this section exists, it can be edited in
Extra/Settings/Generic.

Then you should fix the values BaseDir, LogBaseDir, HIDDir. You can do it 
either directly in ~/.testtoolrc or in the testtool by Extra/Settings/Profile. 
You can add its own profile. Note that the attached .testtoolrc uses 
values from the profile "Novell OOo-2.0" by default.

4. You can start a test (a .bas file from qa/qatesttool directory). There are 
two ways how to do it:

a) You can start testtool.bin; open a .bas file by File/Open; and run it by 
Program/Start (F5)

b) You can start it from command line, for example:
/usr/lib/ooo-2.0/program/testtool.bin -run
~pmladek/OOo/qa/qatesttool/writer/level1/w_autotext.bas

When the test is started, the test tool should open a window with the test log. 
Then it starts OOo from the OOoProgramDir directory with some necessary 
options (-enableautomation -norestore -nolockcheck -autocrashreport). Then it 
communicates with the started OOo instance and do the tests as described in 
the .bas file. The logs are saved in the LogBaseDir. Unfortunately, they are 
not well readable. It is better to see them using the testtool.

Last thing, I suggest you to look into the documentation anyway. You might be 
interested in the info about the various IDs (hid and sid files), about GUI 
test writing, ...

Note: There is a quick introduction into the GUI test writing in the document 
"OpenOffice.org TestTool CookBook", 
http://qa.openoffice.org/qatesttool/OOo_tt_CookBook.pdf. I thing 
that it is better explained in the OOo_testtool.pdf, though.


I hope this helps.
