Difference between revisions of "RU/development/qa/vcltesttool/introduction"
(переводим...) |
(переводим...) |
||
Line 150: | Line 150: | ||
− | + | <nowiki>[</nowiki>Crashreporter] | |
− | + | '''UseProxy'''<nowiki>=true</nowiki> | |
− | + | '''ProxyServer'''<nowiki>=proxy.somewhere.de</nowiki> | |
− | + | '''ProxyPort'''<nowiki>=8080</nowiki> | |
− | + | '''AllowContact'''<nowiki>=true</nowiki> | |
− | + | '''ReturnAddress'''<nowiki>=you@somewhere.de</nowiki> | |
= Selecting the OpenOffice.org Installation = | = Selecting the OpenOffice.org Installation = |
Revision as of 20:54, 10 April 2010
Template:RU/documentation/beingedited Template:RU/documentation/helpneeded
Contents
- 1 Инструментарий для автоматического тестирования OpenOffice.org
- 2 О TestTool
- 3 Расположение TestTool
- 4 Установка TestTool
- 5 Настройка TestTool
- 6 Автоматизированные креш-отчёты
- 7 Selecting the OpenOffice.org Installation
- 8 TestTool Editor
- 9 Starting a TestTool Script
- 10 Result File
- 11 Starting a Test Script From the Command Line
- 12 Run a Batch with Testcases
- 13 Testing a Non-Product Version
- 14 The TestTool Environment
- 15 Configuration file entries
Инструментарий для автоматического тестирования OpenOffice.org
О TestTool
TestTool - это программа, предназначенная для автоматизированного тестирования OpenOffice.org. TestTool взаимодействует через TCP/IP-интерфейс с OpenOffice.org и выполняет тестирование установленного на PC OpenOffice.org. Текущая выерсия TestTool предназначена для работы с OpenOffice.org 3.0 и выше. Однако, в будущем в OpenOffice.org могут быть внесены несовместимые изменения и потребуется обновить версию TestTool.
TestTool связывается с OpenOffice.org, используя SlotIDs, UniqueIDs, и HelpIDs для управления каждым пунктом меню, окнами, диалогами, и диалоговыми параметрами в OpenOffice.org. Идентификаторы генерируются автоматически в OpenOffice.org посторителями процессов или назначаются разработчиками.
SlotIDs | Каждый пункт меню имеет SlotID который используется, например, чтобы открыть диалог или совершить действие. |
HelpIDs | Каждый элемент управления, окно или диалог автоматически получает HelpID для внутренней справочной системы. TestTool использует HelpIDs для идентификации конкретного элемента управления, окна или диалога. |
UniqueIDs | Разработчики могут назначать UniqueID элементам управления, которые не имеют собственного HelpID, чтобы TestTool мог идентифицировать данный котрол. |
Вы можете создать скрипт теста для TestTool на языке программирования StarBasic (подобный VisualBasic). Некоторые команды доступны для TestTool, например, получить или разместить информацию в элементе управления OpenOffice.org. Есть полный список доступных команд, описывающий внутренние команды, методы, и функции TestTool [en]. Вы можете симулировать большинство действий мыши и клавиатуры из TestTool, а так же собирать информацию из элементов управления или изменять установки по умолчанию в OpenOffice.org. Иными словами, TestTool позволяет симулировать поведение пользователя OpenOffice.org.
Расположение TestTool
Окружающая среда TestTool может быть проверена на Mercurial в openoffice.org, и находится в каталоге: testautomation; Или она доступна в виде отдельно пакета.
Приложение TestTool всегда доступно для загрузки. Для других платформ установка так же доступна. Просто используйте двоичный файл из каталога
.../{officepath}/program.
Запустите программу
или
или
Установка TestTool
Для установки TestTool, распакуйсте содержимое загруженного архива TestTool на локальный диск. Если TestTool планируют использовать несколько пользователей, скопируйте распакованный архив на сетевой диск.
После запуска TestTool выполняет файл настроек
или
Если ваш файл настроек TestTool расположен в том же каталоге, что и исполняемые файлы TestTool, то он автоматически буде скопирован в каталог
или
Настройка TestTool
Выберите Extra → Settings → Profile.
При необходимости можно изменить эти настройки в соответствующем конфигурационном файле
CurrentProfile=_profile_Default (...) [_profile_Default] LogBaseDir=/opt/qa/qatesttool/errorlog/mymachine BaseDir=/opt/qa/qatesttool HIDDir=/opt/qa/qatesttool/global/hid
Автоматизированные креш-отчёты
- Выберите меню Extra → Settings → Crashreport.
В последствии можно отредактировать все эти параметры в конфигурационных файлах
[Crashreporter] UseProxy=true ProxyServer=proxy.somewhere.de ProxyPort=8080 AllowContact=true ReturnAddress=you@somewhere.de
Selecting the OpenOffice.org Installation
There are two choices:
Choose Extra - Settings - Misc.
|
If you want, you can also edit these settings in the .testtoolrc / testtool.ini files.
[OOoProgramDir]
Type=Path
Current=/Volumes/OpenOffice.org 2.0.app/Contents/MacOS
All=/Volumes/OpenOffice.org 2.0.app/Contents/MacOS
TestTool Editor
The TestTool uses syntax highlighting for all BASIC, StarBasic, and internal TestTool commands (For more information, see: Internal Commands, Methods and Functions for TestTool). Highlighting can increase the load time for large files.
Starting a TestTool Script
Start local OpenOffice.org installations using the TestTool command line parameter -enableautomation. In the TestTool Environment, executable scripts use the *.bas extension. To run a script, load a *.bas-file, and then run the script from the menu or with a shortcut.
Result File
The TestTool automatically saves a result file during a test script is run. The name of the result file is the name of the script *.bas-file that generated the result, but with the *.res extension (For example: first.bas - first.res). To set the path for saving the result file, choose Extra - Settings - Profile and enter the path in the Log Base directory box.
If a result file already exists, the file is opened and the new result is added at the beginning of the file.
The results are presented as a hierarchical tree list where you can click plus sign (+) or minus sign (-) to expand or collapse the outputs.
- The first output is Reading the files. Expand this entry to see the declaration files. If the entry is orange, the declaration files (*.win / *.sid) contain errors. The sum of the errors is displayed at the end of a test as Warnings occurred during initialization.
- The next output is a short entry that is generated automatically by the start up routines. The entry displays information about the TestTool version, the paths where OpenOffice.org is installed, and where the application was started. The office- and the system language is also displayed.
- Each entry that has a [+] in front of it is a testcase. If the testcase entry is a color other than black, the test contains errors.
- An orange testcase indicates that one or more warnings are present. To see where the error occurred, expand the entry and examine the warnlogs, which are the outputs from the developer of the test script. To jump directly to the place in the test script where a warning occurred, double-click the warning.
- A light green testcase indicates a QAErrorLog entry that was inserted by the developer of the testcase to give the tester some information (for example, about an existing bug or workaround)
- A light blue testcase indicates an Assertion that gives selectable informatoins when testing a debug build of OpenOffice.org.
- A red testcase indicates that one or more errors are present. The tree is expanded to display the error(s). In the example result file, the error occurred when the TestTool did not find the slot. That is because there is a typo in it – it should be ToolsOptions.
- When you expand a red entry by clicking the plus sign (+) in front of the entry, a level by level (sub main - testcase ... - subroutine ... - .....) view of the error is displayed. You can also see what the TestTool did to return OpenOffice.org to a defined base state so that the TestTool can run the next testcase without any open windows or dialogs.For example:
- the WORKINGWINDOW "Untitled2 - OpenOffice.org Writer" is closed (geschlossen = closed)
- Explanation:
- the working document is closed
- The TestTool then started the next testcase at the base state of OpenOffice.org (that is, with one open document and no open dialog).
- At the end of a test, the number of errors and warnings is displayed
Starting a Test Script From the Command Line
To start a test-script from the command line, use the following syntax:
testtool.exe [/port=xxx /host=xxx] startprogram /run [/result xxx] [/printlog] | |
/Port
|
The com port on the machine that the TestTool uses to communicate with OpenOffice.org. If you do not include this parameter, the TestTool looks for relevant information in the .testtoolrc or testtool.ini files. |
/Host
|
The hostname of the machine that contains the OpenOffice.org installation that you want to test. If the installation is on the same machine as the TestTool, enter localhost. If you do not include this parameter, the TestTool looks for relevant information in the .testtoolrc or testtool.ini files.(only localhost is supported) |
Startprogram
|
The *.bas-file that contains the main-routine. |
/run
|
Runs the test script, writes the result to the result file, and exits the TestTool at the end of the test. |
/result
|
Limits the number of testruns to xxx excluding the current one in the resultfile (0,1,2,...). The action gets executed on running the testcase. |
/printlog
|
write the information written to logs on stdout ***** UNIX only ! ***** |
Example: | testtool.exe /port=12481 /host=localhost /opt/qatesttool/writer/update/w_update.bas /run |
The TestTool runs the w_update.bas-test on the local machine through port 12481, and exits the TestTool when the test is done. |
Run a Batch with Testcases
- There are examples for Win32 and Unix at http://hg.services.openoffice.org/DEV300/file/1467f46f8817/testautomation/tools/run_tests.
Testing a Non-Product Version
- Define the files where you want to store the debug-settings for OpenOffice.org by inserting the following section into the win.ini file (If you don't have access to the file, you may use environment variables.):
[SV] dbgsv=c:\dbgsv.ini dbgsvlog=c:\dbgsv.log
- On Linux/Unix/Win32 Platforms you have to set an environment variable to control where the debug-settings are stored:
DBGSV_INIT=/some/path/dbgsv.ini DBGSV_LOG=/some/path/dbgsv.log
- In OpenOffice.org, press Shift+Ctrl+Alt+D, and then select TestTool in the Error list box.
- In the TestTool, assertions are indicated by light blue. To manually reproduce an assertion, select MessageBox in the Error list box.
The TestTool Environment
The TestTool Environment contains the start scripts, the test scripts, and the libraries (include files) that are required to automatically test OpenOffice.org. The TestTool Environment is modular, so that a module exits for each application or area that you want to test in OpenOffice.org. To test a single OpenOffice.org application, such as Writer, you only need the application module and the global module.
module name / path name | Description |
---|---|
application modules | |
dbaccess | Database / Data source functionality in OpenOffice.org |
spreadsheet | Calc (spreadsheet) |
chart2 | Chart, the functionality of charts in a spreadsheet |
graphics | Impress (presentation application) and Draw (drawing application) |
math | Math (formula) |
extensions | Extensions functionalities |
writer | Writer (text document, HTML document, master document) |
xml | XML file format for all of the OpenOffice.org applications |
general modules | |
framework | General functionality for all applications (for example, galleries and extras) |
global | All general routines (for example, startup, tooling, declaration files) |
tools | Useful standalone applications (hid.lst perl script) |
The following subcategories are defined for the TestTool Environment modules:
module name / path name | Description |
---|---|
required | Resource test: Activates all menu items and opens all dialogs of the tested application. |
optional | Performs a general functionality test for each feature in the tested application, including each menu item. |
tools | Includes libraries that contain the general subroutines that are required by all test scripts in the module or application. |
These are only the defined name, you can also find other subcategories in the paths. Mostly the named of the directory mirror the tested area.
If you find a *.bas-file in one of these directories you are in a test-module. Those module should include the following directories/files:
module name / path name | Description |
---|---|
*.bas | Indicates executable test scripts. To run the script, open the *.bas file in TestTool, and then press F5 or choose Program - Start. |
inc | Includes the libraries and any associated files that are required for a test (included by use-method in the *.bas-file) |
input | Inputs the files that are required for the test. |
tools | Includes libraries that have general subroutines that are required by test scripts (*.bas). The libraries must be in the same directory as the test script. |
global-Module
The global-directory is required for each test. The directory contains the main routines for running a test script, including the hid.lst, the declaration files that identify menu items, dialogs and controls in OpenOffice.org, and general tooling routines.
directory name | description |
---|---|
hid | Contains the hid.lst file. |
input | Contains common files that are required by the TestTool.
|
sid | Includes all SlotID declarations. |
system | Contains the routines to start a test script in these inc-files. |
tools | Contains general tooling routines in these inc-files (for example, declare.bas). |
update | Contains general resource-test routines in these files (options-dialog and autopilots) |
win | Contains all HelpID declarations. |
Configuration file entries
The configuration file (UNIX: .testtoolrc, Win32: testtool.ini) contains several sections.The section name is surounded by '[', ']' and contains several entries like: EntryName=Value.
GUI Platform
Current= depends on the Platform.
UNIX | Win32 | ||
Subsystem | Current | Subsystem | Current |
Solaris SPARC | 01 | Win 95 | 100 |
SCO UNIX | 02 | Win 98 | 395 |
Linux | 03 | Win NT 3 | 351 |
AIX | 04 | Win NT 4 | 400 |
Solaris x86 | 05 | Win SE | 410 |
Irix | 06 | Win ME | 490 |
HP | 07 | Win 2000 | 500 |
FreeBSD | 08 | Win XP | 501 |
Mac OS X | 12 | Win Server 2003 | 502 |
Linux PPC | 13 | ||
NetBSD | 14 | ||
Linux 64 bit | 15 | ||
Linux SPARC | 16 | ||
eComStation | 17 |