Приложение А: Справочник команд

From Apache OpenOffice Wiki
< RU‎ | qa‎ | vcltesttool
Revision as of 19:09, 10 April 2010 by Sancho (talk | contribs) ({{RU/documentation/helpneeded|Перевод на русский язык}} {{DISPLAYTITLE:Введение для тестеров локализаций}} {{RU/vcltesttool/vcltesttooltoc)
Jump to: navigation, search

Template:RU/documentation/helpneeded




Internal Commands, Methods and Functions for TestTool

The programming language used is StarBasic. In addition to the general commands of StarBasic, the commands on this page work with VCL TestTool.

Testscript Structure

Kontext String:Window Specifies the dialog or window that you want to test. You can use all of the controls in the dialog or windows, so long as you declared the 'Kontext' in the win-files. Furthermore, if you do not declare the 'Kontext', you cannot work with the dialog or window. For example, If you want to write to a Writerdocument, you must include the following:
Kontext "DokumentWriter"
DokumentWriter.TypeKeys "This is a test."
sub main
...
end sub
Specifies the main routine for the TestTool. Write 'sub main' in lowercase letters with only one space between the two words. As the 'LoadIncludeFiles' routine is called at the start of a test script, the routine must be in the bas-file that contains the 'sub main' routine.
sub LoadIncludeFiles
use "inc\gvariabl.inc"
use "inc\master.inc"
call GetUseFiles ()
...

end sub

This routine must be included in the bas-file that contains the 'sub main' routine.
sub TestEnter

...

end sub

The TestEnter routine is located in the master.inc file and is automatically called when the testscript enters a testcase routine.
sub TestExit

...

end sub

The TestExit routine is located in the master.inc file and is automatically called when a testscript exits a testcase-routine.
testcase
...
endcase
A special test routine that tests one item, such as a control. The words testcase and endcase must be written in lowercase. If an error occurs in a testcase, the testcase ends and OpenOffice.org is reset to a base state. The error is then written to the resultfile.
try
...
catch
...
endcatch
If you want to circumvent an error, use the try-catch-endcatch method. If an error occurs during the try-part, the test breaks and jumps to the catch-part. You can only branch this method once, that is, you can add a try..catch..endcatch in the try- or in the catch-part, but only in one level.
sub startTheOffice
...
end sub
The startTheOffice routine is located in the master.inc file and is automaticall called when TestTool does not find an running OpenOffice.org to communicate with. It needs to contain at least the command 'start'.

Global

ActivateDocument nNr Activates the document window that has the number that you specify. Note: The list of document windows does not correspond to the order in which the windows are opened, that is, you do not know which document corresponds to which number.
AppAbort Deletes all communication-instructions in the queue between the TestTool and OpenOffice.org.
AppDelay nNr Waits in OpenOffice.org (not in TestTool) for the number of milliseconds that you specify.
Boolean ApplicationBusy Returns 'FALSE' if the OpenOffice.org is in the waitcursor state, otherwise returns 'TRUE'.
Assert [Text] Outputs an assertion from TestTool.
AutoExecute = Boolean If AutoExecute = FALSE, all commands behind it are collected, otherwise the commands are executed. You can also use Execute to run the collected commands.
CaptureAssertions [Bool] To catch the assertions in TestTool, set this variable to TRUE, otherwise set the variable to FALSE to throw the assertions back to OpenOffice.org.
caselog "" Stops the output at startup (used behind the win-declaration output)
catchGPF [Bool] Usually the VCL TestTool Application tries to handle crashes (default: TRUE). With FALSE this is disabled, and the crash is handled by the OpenOffice.org crashreporter.
DialogHandler String Old instruction – N/A
DisplayHid [TRUE] Call DisplayHid to display a window in OpenOffice.org that lets you select the windows that you want get the UniqueIDs for. To declare windows, use the declare.bas script.
Window.DisplayPercent A method on Windows for returning information about the mouse position in the window. The position is given as a percentage of the distance between the top left corner of the window (0,0) and the bottom (0,100) and right (100,0) edges of the window.
ErrorLog Writes the last error to the resultfile (without a callstack).
ExceptLog Writes the last error to the resultfile with a callstack.
Execute Executes the collected commands when AutoExecute = FALSE
Object findObject String Returns the object of String. E.g.: x = findObject “FormWizard”; print x.name
String GetApplicationPath Returns the correct path to TestTool.ini / .TestToolrc.
String GetChildEnv String


Gets an environment variable that was previous set by SetChildEnv.
String GetClipboard Returns the string from the OpenOffice.org clipboard. If the clipboard contains a picture, nothing is returned.
[tt_env] String GetClipboardText Supplies the real string from the clipboard. Use this function to return the information that is selected in a document. This function is not an internal TestTool command, but rather a function from the TestTool Environment.
String GetCommonApplicationPath Returns the correct path to sversion.ini / .sversionrc and testtool.ini / .testtoolrc in case of a 'all user installation mode'.
USHORT GetDocumentCount Returns the number of open documents in the OpenOffice.org installation that you are testing.
String GetLinkDestination String Linux/Unix: Return the destination of a link. Win32: String is returned.
String getRegistryValue (String1, String2) Win32: Read a string value from the registry. String1 is a path schemata of either HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE. String2 is the key name to read. Linux/Unix: return string is always empty.
String GetTestCaseFileName Returns the file name of the current testcase, otherwise this function returns an empty string. This file name is useful for the statistics output in the recover routine.
Nr GetTestCaseLineNr Returns the line number of the current testcase.
String GetTestcaseName Returns the name of the current testcase. Outside a testcase it returns an empty string. The testcase name is useful for the statistics output in the recover routine.
GPF Crashes OpenOffice.org.
Integer HTTPSend (String Host, String Path, Integer Port [,String Filename]) Retrieve a web page. For example: to save the page: http://www.heise.de/HttpSend(“www.heise.de”,”/”,80,”/opt/heise.html”); The returnvalue is the HTTP result (200 if OK).
HTTPSetProxy (String Host, Integer Port) Set a proxy to use by HTTPSend.
Bool IsProduct Returns FALSE if OpenOffice.org is a debug / non product build, else TRUE.
KillApp Kill the OOo application that was started by the command Start.
String MakeIniFileName (String BaseName) Returns the correct name of an ini-file on the current operating platform.For example, MakeIniFileName (“TestTool”) returns TestTool.ini on Windows and .TestToolrc on UNIX.
NoDebug / Debug Deprecated.
PrintLog String Writes a string to the resultfile
Profile [Bool][,nNr1][,nNr2][,nNr3][,nNr4][,String] Get system-information. File is written to Resultdirectory with extension PRF.
  1. profile ' start profiling for every command
  2. profile String ' print String in result file
  3. profile Integer ' write result every Integer ms
  4. profile true,1,10,100,1000' define time bins in ms and start profiling
  5. profile false ' stop profiling. print results
RemoteCommandDelay [msec][,msec] |TRUE | FALSE Delays the execution of OpenOffice.org commands (=remote) (not local BASIC routines).

functions:

  • msec,[msec] is the delay range (for example, if you enter 100,100, the delay is always 100 msec, whereas if you enter 100,200, the delay can be 100, 120, ... 130, ...190, 200). The second value is OPTIONAL.
  • TRUE | FALSE Boolean expression for enabling or disabling the delay.

Examples:

  • RemoteCommandDelay 100
    RemoteCommandDelay TRUE
  • RemoteCommandDelay 100,200
    RemoteCommandDelay TRUE


String ResetApplication Returns OpenOffice.org to its base state and returns the taken actions of which windows were closed and how as string.
SetChildEnv String1, String2


Sets an environment variable that will get passed to the childprocess started by start.
SetClipboard String Copies a string to the clipboard
Start exe-file [, String2 ] Starts OpenOffice.org and opens the communication between OpenOffice.org and the TestTool. Use start sAppExe in a script file to specify the OpenOffice.org application that you want to start.
TypeKeysDelay Nr1 [,Nr2] | Bool Sets a delay in ms between 2 characters typed by the .typeKeys method.
  1. TypeKeysDelay 1000 ' 1 second delay
  2. TypeKeysDelay 500, 1000 ' randomly delay from 0.5 to 1 second
  3. TypeKeysDelay true | false ' enable | disable delay
WarnLog String Writes a warning to the resultfile.
QAErrorLog String Writes the string that you specify when this function is encountered in a test script or by internal TestTool code (Example: Extracting an XML package over existing XML files returns a QAError that tells the QA engineer that the directory is not empty). You enable or disabled the logging of these QA errors/notes with EnableQAErrors.
EnableQAErrors = [Bool] Enables or disables the logging of QAErrorLogs. The default value is TRUE (=on). See the QAErrorLog command.
WinTree Shows the complete window hierarchy of OpenOffice.org, so long as you set the output to a variable. Use the following structure to show the complete tree:
Dim sInterim
sInterim = WinTree
Printlog sInterim
Use Include file If you want to use inc-file in a subroutine, you must add the files with the use-instruction. If you want, you can use relative pathnames (relative to TestTool path in TestTool.ini/.TestToolrc) or absolute pathnames.
UseBindings = TRUE
UseBindings = FALSE
A test script aborts if you call a menu item slot that requires parameters. In this case, set 'UseBindings=TRUE' before the slot call. If the scripts still crashes, write the bug UseBindings => FALSE in each ResetApplication-Routine in TestEnter and TestExit.
usePostEvents Bool The implementation in the TestTool for .typeKeys, .MouseUp, .MouseDown and .MouseMove changed from OOo 2.1 to 2.2; To change to the old behaviour use FALSE
Ushort waitSlot [msec] Returns WSTimeout or WSFinished, depending on the state of the last called slot. The command will return after msec or when the slot is finished.

Statistic

Integer getErrorCount Returns the matching count of errors in the running test.
Integer getWarningCount Returns the matching count of warnings in the running test.
Integer getUseFileWarningCount Returns the matching count of warnings out of the declaration part in the running test.
String getErrorList Return an array of strings. Each item consists of fields seperated by a colon.The fields are:1. Path to source file where Error ocurs2. Line number in source file3. cvs Revision, if available4. Error message
String getWarningList Same as above, but for Warnings.

Commands on The Office Side

These commands work in OpenOffice.org applications and not in TestTool. You can also use them for remote testing. For normal file commands, please use BASIC commands.
String app.Dir Filename You can get the information if a file/directory exists or not. For example: for the files: if app.dir ("d:\officedir\program\soffice.exe") <> "" than print "The file exists!"for directories: if app.dir ("d:\officedir\", 16) <> "" than print "the directory exists!"
app.Kill Filename Deletes a file.
app.rmDir Filename Deletes a directory (only an empty directory)
app.mkDir Filename Creates a new directory.
app.FileCopy Old_filename, New_filename Copies a file.
app.Name Old_filename, New_filename Renames a file.
nSize app.FileLen Filename Returns the length of a file.
Date app.FileDateTime Filename Returns the date that a file was created.
GetSystemLanguage Returns the ISO language code (Integer) of the system that the OpenOffice.org application is running on.

Windows, Controls and Objects

Any Control, Window, Object

String Object.Caption Returns the name of dialogs (name on the titlebar of a dialog) or controls. For controls that do not have a name, the returnvalue is empty. Only the fixedtext belongs to a control.
Bool Object.Exists [Timeout in Sek.] Checks to see if a dialog or a control exists.
String Window.GetFixedText [Nr] Returns the content of the nth fixed text. If you do not specify the [Nr] parameter, the first fixed text is returned.
Nr Window.GetFixedTextCount Returns the number of fixed texts on a given window or control and associated child windows or controls.
Nr Object.GetRT Returns the resource type of the object, window, or control
Nr Window.GetPosX Returns the x-position of the edge at the top left (in pixels).
Nr Window.GetPosY Returns the y-position of the edge at the top left (in pixels).
Nr Window.GetSizeX Returns the x-size of a dialog (in pixels).
Nr Window.GetSizeY Returns the y-size of a dialog (in pixels).
Nr Object.ID Returns the UniqueID of a window or a control.
Bool Object.IsEnabled Checks if a control is enabled.
Bool Object.IsVisible Checks if a control or a window is visible.
Objekt.MouseDown x, y [, nButton ] [,Focus] Presses the mouse button at the specified x/y-position (in percent) in a window. Ensure that you use the mouseup command after each instance of the mousedown command.nButton is:
  • 1 = left mouse button
  • 2 = middle mouse button
  • 3 = right mouse

The default (without nButton) is the left mouse button.

If the MouseDown and MouseUp combination does not work like a normal mouse click, then set the Focus parameter to TRUE. (x,y):= (1,1) top left; (99,99) bottom right

Objekt.MouseDoubleClick x, y [, nButton ] [,Focus] Double-clicks with a mouse button at the x/y-position (in percent) of a window.If MouseDoubleClick does not work like a normal mouse double click, set the Focus parameter to TRUE.
Objekt.MouseMove x, y [, nButton ] [,Focus] Moves the mouse. To perform a mouse drag and move or drag and copy, add the MouseDown command before the MouseMove.
Objekt.MouseUp x, y [, nButton ] [,Focus] Releases the mouse button.If the MouseDown and MouseUp commands do not work like a normal mouse click, set the Focus parameter to TRUE.
Autoexecute = FALSE
Objekt.MouseDown x, y [, nButton ] [,Focus]
Objekt.MouseUp x, y [,nButton] [,Focus]
Autoexecute = TRUE
Use this construction for a rapid mouse click.By setting the appropriate gApplication, you can use the following subroutine for every OpenOffice.org document.gMouseClick (x, y)
[nNr.] GetMouseStyle Returns the actual state/look of the cursor, from a list of 85 possible values. Some important states: ARROW = 0, TEXT = 3, MOVE = 6 (moving objects), REFHAND = 28 (links/references) and FILL = 31(fillbox).
String Object.Name Returns the name of the object from the declaration.
Bool Object.NotExists [Timeout in Sek.] Checks to see if a control or window does not exist.
Objekt.OpenContextMenu [Focus] Opens the context menu of a window. If you set the Focus parameter to TRUE, the context menu opens at the position of the mouse.To open the context menu at a specific position in a window, you have to first move the mouse to the position before using the OpenContextMenu command.
Object.SnapShot String:Dateiname [PosX, PosY, SizeX, SizeY ] Takes a screenshot of a control or a window. If you want, you can also specify the position and size of the screenshot in pixels.
Dokumentobject.TypeKeys String [Nr.] [, Focus] Prints a string on the document, where Nr. is the number of times that you want to print the string.To use special keys, enclose them with "<>". For example: DokumentWriter.TypeKeys "<Shift F1>"

The Focus parameter is a Boolean expression. Normally, typekeys works without this parameter; however, to set the typekeys command directly in this window, set the Focus parameter to 'TRUE'. Use this parameter only when the normal command does not work correctly.

CheckBox

Image-CheckBox

[ Restype: 336 ], [ Restype: ??? ]

Object.Check Selects the check box.
Object.Click Changes to the next state of the check box, that is, removes the check mark from a selected check box.
Bool Object.IsChecked Returns the state of the check box (TRUE = selected).
Object.UnCheck Clears the check box.

ComboBox

[ Restype: 340 ]

Nr Object.GetItemCount Returns the numbers of entries in the combo box.
String Object.GetItemText Nr Return the text of Nr. entry that you specify, including an entry that is not selected.
Nr Object.GetSelCount Returns the numbers of the entries that are selected in a combo box (You can select more than one entry).
Nr Object.GetSelIndex [Nr] Returns the index of the selected entry in the list.
String Object.GetSelText [Nr] Returns the text of the selected entry.
Object.Select Nr Selects an entry with the index number that you specify.
Object.Select String Selects the entry that has the same text as the String that you specify.
Object.SetNoSelection Sets no selection in a list (sometimes this corresponds to the first entry in the list).
Object.SetText [String] Enters the text string that you specify in a combo box. If the combo box contains an entry that matches the string, the entry is selected.

Dialog

ModelessDialog

[ Restype: 314 - 316 ]

Dialog.Cancel Closes a dialog by pressing the Cancel button.
Dialog.Close Closes a dialog with the Close button.
Dialog.Default Not important
Dialog.Help Presses the Help button to open the help topic for the dialog.
Dialog.Move Nr:x, Nr:y Moves a dialog in OpenOffice.org by the number of pixels that you specify.
Dialog.OK Closes a dialog with the OK button.

DockingWin

[ Restype: 370 ]

Window.Close Closes a window by pressing the X button in the title bar of the window.
Window.Dock Docks a window on one edge of the StarDesktop.
Window.Help Opens the Help viewer.
Bool Window.IsDocked Returns the docking state.
Bool Window.IsMax Returns the state of the window (maximize or minimize).
Window.Maximize Maximizes a window so that the contents of the window are visible.
Window.Minimize Minimizes a window so that only the title bar of the window is visible.
Window.Move Nr:x, Nr:y Moves a window.
Window.Size Nr:x, Nr:y Resizes a window.
Window.Undock Undocks a window.
=== Splitting Windows ===

(in dockingmode)

Bool Office.IsPin [Align] Returns the state of the pin.
Bool Office.IsFadeIn [Align] Returns the state of a window (visible or not).
Office.Pin Bool [Align] Presses the pin.
Office.FadeOut [Align] Fades out a window (visible).
Office.FadeIn [Align] Fades in a window (not visible).
If there is more than one splitting window in a docking window, you must set the following Align operators. - AlignLeft- AlignRight- AlignTop- AlignBottom

EditWindow

(Documents - the active SDI window) [ Restype: 312 ]

Special Note:The first document is not enabled for the TestTool - most of the slot (calls of menu items) and TypeKeys commands do not work. This is a feature and not a bug.
Boolean Documentobject.HasScrollbar [Align] If the document has a scrollbar => TRUE
Boolean Documentobject.IsScrollBarEnabled [Align] If the document has a scrollbar and it is enabled => TRUE
If more than one scrollbar is visible, use the following parameters to define the position of the scrollbar. The default is AlignRight. - AlignLeft- AlignRight- AlignTop- AlignBottom For example:if (DocumentWriter.IsScrollBarEnabled AlignLeft) = TRUE then ...
Documentobject.Close Close document.
Boolean Documentobject.IsMax If document is maximized => TRUE
Boolean Documentobject.IsMin If document is minimized => TRUE
Boolean Documentobject.IsRestore If document is restored => TRUE
Documentobject.Maximize Maximize document.
Documentobject.Minimize Minimize document.
Documentobject.Restore Restore document.

Edit-Field

MultiLineEdit-Field

[ Restype: 338 ], [ Restype: 339 ]

String Object.GetText Returns the text from the edit field.
Object.SetText String Enters the text string in the edit field.
Bool Object.IsWritable Checks if a control is writable (only for visible Edit- and MultiLine Edit- fields).

FloatWin (Flyer)

[ Restype: 313 ]

Window.Close Closes the window (x-button in the title bar of the window).
Window.Help Opens the help for the current window (help button).
Bool Window.IsMax Returns the state of the window (maximize or minimize).
Window.Maximize Maximizes the window.
Window.Minimize Minimizes the window so that only the title bar is visible.
Window.Move Nr:x, Nr:y Moves the window by the number of pixels that you specify.
Window.Size Nr:x, Nr:y Resizes the window.

ListBox

MultiListBox

[ Restype: 341 ], [ Restype: 342 ]

Nr Object.GetItemCount Returns the number of entries in a list box.
String Object.GetItemText Nr Return the text of entry Nr. in the list box.
Nr Object.GetSelCount Returns the number of selected entries in a multi-list box (you can select more than one entry).
Nr Object.GetSelIndex [Nr] Returns the index number of the selected entry in the list.
String Object.GetSelText [Nr] Returns the text of the selected entry. If more than one item is selected, use Nr. to specify which entry to return.
Boolean Documentobject.HasScrollbar [Align] If the document has a scrollbar => TRUE
Boolean Documentobject.IsScrollBarEnabled [Align] If the document has a scrollbar and it is enabled => TRUE
If more than one scrollbar is visible, you have to use the following parameters to add the position. The default is AlignRight. - AlignLeft- AlignRight- AlignTop- AlignBottom Example:if (DocumentWriter.IsScrollBarEnabled AlignLeft) = TRUE then ...
Object.Select Nr Selects an entry and its index.
Object.Select String Selects the text of an entry.
Object.SetNoSelection Set no selection in a list (sometimes this corresponds to the first entry).

MenuButton

[ Restype: 331 ]

Button.Click 1. Performs the function that is assigned to a menu button, otherwise the menu of the button is not opened.2. For menu buttons that are accessed through a context menu, use the [all_commands_short.sxw#menu menu-instructions].
Button.Open Opens the context menu of the menu button so that you can use the [all_commands_short.sxw#menu menu-instructions].
Button.OpenMenu Opens the context menu of the menu button so that you can use the [all_commands_short.sxw#menu menu-instructions]. To close the menu on a toolbox item, call .openMenu again.
Toolbox.OpenMenu ButtonID Opens the context menu of the menu button in Toolbars so that you can use the [all_commands_short.sxw#menu menu-instructions].

Menu and Context Menu

Special notes:The following instructions can only be carried out on an open context menu or an open sub context menu, otherwise and error is returned. Only use these instructions if you cannot find an equivalent instruction in the menu.inc file. Warning: Make sure that you close each context menu after the instruction has been carried out, otherwise the test encounters a GPF (crashes).
Objekt.OpenContextMenu [Bool] Opens a context menu for a window or a document.The Boolean parameter in StarSchedule and in base documents must be set to TRUE. The default value is FALSE.
nNr MenuGetItemCount Returns the numbers of menu entries (including the menu separators)
nID MenuGetItemID nPos Returns the ID of an menu entry (the ID is required for the remaining menu instructions).
nNr MenuGetItemText nID Returns the text of the menu entry that has the same nID as the one that you specify (from MenuGetItemID).
nNr MenuGetItemPos nID Returns the position of the menu entry that has the same nID as the one you specify (from MenugetItemID).
Bool MenuHasSubMenu nID Returns TRUE if the menu entry opens a submenu.
Bool MenuIsItemChecked nID Returns the state of a menu entry with a hook (from MenugetItemID).
nNr MenuIsItemEnabled nID Returns the state “disabled” or “enabled” (from MenugetItemID)
Bool MenuIsSeperator nPos Returns TRUE if the menu entry is a separator.
MenuSelect nID Activates the menu item that has the same nID as the one that you specify. If the menu does not automatically close after you activate it, you must close the menu using MenuSelect (0).
MenuSelect (0) Closes all active menus.
=== special methods ===


DocumentWindow.UseMenu Use this method before you activate a menu in a document. For example: Kontext “DocumentWriter”DocumentWriter.UseMenuAfter you apply this method, you can then use the normal [all_commands_short.sxw#menu menu-methods].
String MenuGetItemCommand nItemID Reads out the command of a MenuItem. This is useful for determining the UNO URLs so you can declare the UNO Slots.
Description: The first menu is the menu bar with the entries (File, Edit, View ...). To open the File-Menu, open the submenu of the first menu entry.

MessBox / InfoBox

WarningBox / ErrorBox

QueryBox

[ Restype: 304 - 308 ] (Messagebox)(these boxes are handled by the active-operator)

Active.Cancel Closes the box with the Cancel button.
Active.Click ButtonID Not important
Active.Default Closes the box with the Default button (that has the focus).
Active.GetText Returns the text from the messagebox.
Active.No Closes the box with the No button.
Active.OK Closes the box with the OK button.
Active.Repeat Closes the box with the Repeat button.
Active.Yes Closes the box with the Yes button.

with checkbox(es)

String Active.GetCheckBoxText Puts the text of the check box into a string.
BOOL Active.IsChecked Returns TRUE if the box is checked, otherwise FALSE is returned.
Int Active.GetState Returns the state of the checkbox as integer
Active.Check Selects the check box on the message/info/warning/error/query box.
Active.UnCheck Clears the check box on the message/info/warning/error/query box.

MoreButton

(for additions in a dialog)

[ Restype: 332 ]

String Object.Caption Returns the text of the button.
Object.Click Clicks the button.
Object.Close Closes the addition window.
Bool Object.IsOpen Returns the state of the addition window (TRUE == Open).
Object.Open Opens the addition window.

PushButton, ImageButton

[ Restype: 326 ], [ Restype: 330 ]

Object.Click Clicks the button.

RadioButton, ImageRadioButton

[ Restype: 334 ],[ Restype: 335]

Object.Check Selects the radio button.
Bool Object.IsChecked Returns the state of the radio button (TRUE = checked).

SpinField

PatternField

NumericField

MetricField

CurrencyField

DateField

TimeField

[ Restype: 353 - 359 ]

String Object.GetText Returns the text from the field.
Object.More [ Nr ] Moves one entry higher.
Object.Less [ Nr ] Moves one entry lower.
Object.SetText String Prints text in the field (only in the right format).
Object.ToMax Goes to the maximum value.
Object.ToMin Goes to the minimum value.

StatusBar

(on edit-windows - documents)

Int DocumentWindow.StatusGetItemCount Returns the number of items on the status bar.
Int DocumentWindow.StatusGetItemID nNr Returns the ItemID of a control on the status bar.
String DocumentWindow.StatusGetText [ ItemID ] Returns the text of the status bar or of the item that has the ItemID that is not on the status bar.
Bool DocumentWindow.StatusIsProgress Returns true if the status bar is a progress bar.

System Dialog

(system File- or Folder-dialogs - only for Win32)

Boolean ExistsSysDialog (which) Returns TRUE if a system dialog is open (which = FolderPicker or FilePicker).
CloseSysDialog (which) Closes the system dialog (which = FolderPicker or FilePicker).
FolderPicker If you want to handle a system folder dialog, you have to substitute the FolderPicker method for the 'which' statement in the above methods.
FilePicker If you want to handle a system file dialog, you have to substitute the FilePicker method for the 'which' statement in the above methods.

TabPage

[ Restype: 372 ]

for activating a Tabpage with the 'Active'-Operator (normal TabDialogs) for activating a Tabpage with the TabControl-Operator (only special dialogs)
Kontext

Active.SetPage TabZeichenKontext "TabZeichen"

Kontext "XYZ-Dialog"

TabControl.SetPage TabZeichenXYZNote: Do not use Kontext "Active" before Active.SetPage – this no longer works.

Nr Active.GetPage Returns the UniqueID for the active tab page.
Nr Active.GetPageCount Returns the number of tab pages in the dialog.
Nr Active.GetPageId [Nr] Returns the TabpageID from the dialog. This not the UniqueID and is only needed for the SetPageID instruction.
Active.SetPage TabpageObjekt Changes to the tab page that you specify.
Active.SetPageId Nr Changes to the tab page that has the TabpageID that you specify.
Active.SetPageNr Nr Not important

Toolbar

[ Restype: 369 ]

Button.Click Activates or deactivates a button.
String Button.GetItemText nNr Returns the text of a button (if available).
nNr Button.GetState nType Returns the state of a button in dependent on nType.nType = 0 => HelpID (0 = Separator)nType = 1 => ItemTyp (1=Button, 3=Separator ...)nType = 2 => ItemState (1=pressed, 0=not pressed)nType = 3 => ItemIDelse => HelpID
String Toolbar.GetText Returns the internal name of a toolbar.
Button.TearOff Tears off a toolbar, but only after a toolbar has been opened by clicking on a button.(You do not need to click click the button a second time)
Nr Toolbar.GetItemCount Returns the number of items in a toolbar (buttons and separators).
String Toolbar.GetNextToolbox Returns the next toolbar if you can change to another toolbar that has a button on it.
Toolbar.SetNextToolbox [ String ] Changes to the next toolbar, or to the toolbar whose name you enter.

ValueSet

BrowseBox

TreeListBox

[ Restype: 376 ]

The column number is optional. If it is not given, the first found appropiate column is chosen. If you take an action for a checkbox, the first found checkbox is used. If a checkbox is not found, an error is thrown. If the column number is given, you use an action for a checkbox, the item is no checkbox, an error is thrown.


Integer Object.GetItemCount Returns the number of rows.
ItemType Object .getItemType [row Integer [, column Integer]] Returns the item type. ItemType can be of the following defined constants:
  • ItemTypeText
  • ItemTypeBMP
  • ItemTypeCheckbox
  • ItemTypeContextBMP
  • ItemTypeUnknown
String Object.GetItemText row Integer [, column Integer] Returns the text.
Integer Object.GetSelCount Returns the number of selected entries.
Integer Object.GetSelIndex [Integer] Returns the index of the selected entry in the list.
String Object.GetSelText ([row Integer [,column Integer]]) GetSelText returns the text of the selected entry.GetSelText 1,2 returns the second text of the first selected entry (if the list box has more than one column.GetSelText 2 returns the first text of the second selected entry.
String Objekt.GetText Returns the text of the selected entry.
Object.Select Nr [, Bool ] Selects an entry by number.
Object.Select String Selects an entry by string.
Object.setNoSelection Unselect all.

with Checkbox(es)

Boolean Object.IsChecked Integer row [, Integer column] If the check box is selected => TRUE else FALSE
Boolean Object.IsTriState Integer row [, Integer column] If the check box is in tri state => TRUE else FALSE
Nr Object.getState Integer row [, Integer column] Returns the state of the box:

Unchecked == 0 Checked == 1 TriState == 2

Object.Check Integer row [, Integer column] Selects the check box.
Object.Uncheck Integer row [, Integer column] Clears the check box.
Object.TriState Integer row [, Integer column] Sets the check box in tri state.

TriStateBox

[ Restype: 337 ]

Object.Check Selects the tristatebox.
Object.Click Changes to the next state of the tristatebox.
Nr Object.GetState Returns the state of the box: Unchecked == 0 Checked == 1 TriState == 2
Bool Object.IsChecked Returns the checkstate (TRUE == checked).
Bool Object.IsTriState Returns the tristate (TRUE == in tristate).
Object.TriState Puts the object in the tristate.
Object.UnCheck Clears the tristatebox.

EditBrowseBox

[ Restype: ]

String Object.getSelText Returns the text of the selected field.
Integer Object.getColumnCount Returns the number of columns.
Integer Object.getRowCount Returns the number of rows.
Bool Object.isEditing Returns TRUE if the field is in edit mode.
Object.select (Integer Row, Integer Column) Go to the given field.

Roadmap

[ Restype: ]

Integer Object.GetItemCount Returns the number of entries in a list.
String Object.GetItemText Integer row Return the text of entry row in the list.
Integer Object.GetSelIndex Returns the index number of the selected entry in the list.
String Object.GetSelText Returns the text of the selected entry.
Boolean Object.isItemEnabled Integer row If the item is enabled => TRUE
Object.select Integer row Select the item in row.


Working With XML Files

Introduction

In the SAX interface that is included in OpenOffice.org, you can use the XML parser "eXpat" so that you can easily work with XML files in the TestTool environment. The SAXReadFile command creates a DOM (Document Object Model; a tree like 'view') where you can navigate with TestTool commands.

Main Commands

SAXReadFile filename Recommended command to open the XML file (or stream). The command checks well-formedness and creates a DOM.
SAXRelease After TestTool has finished using the XML file, this command closes the DOM.
String SAXCheckWelltformed filename Opens an XML file, checks the well-formedness of the file, and returns any errors in a string. This command does not create a DOM. Open DOMs are closed after this command is executed.

Working With Elements, Attributes And Characters

String SAXGetNodeType The operations that you can perform with nodes depends on the type of node. There are two types of nodes that are also constants:
    1. NodeTypeElement
      1. Includes other nodes and elements (this is the most important function)
      2. Functions
        • SAXGetElementName
        • SAXGetAttributeCount
        • SAXGetAttributeName
        • SAXGetAttributeValue
    2. NodeTypeCharacter
      1. SAXGetChars is the only function that returns the characters from that node.


String SAXGetElementName Returns the name of the XML element at the current 'pointer' location.
String SAXGetChars Returns the characters from the node type: NodeTypeCharacter.
String SAXGetAttributeValue integer Returns the value of the nth attribute in the recent node.
String SAXGetAttributeValue String Returns the value of the named attribute in the recent node.
Integer SAXGetAttributeCount Returns the count of attributes in the recent node.
String SAXGetAttributeName int Returns the name of the nth attribute in the recent node.


Navigate And Search in The DOM

Integer SAXGetChildCount Returns the count of child nodes (XML elements).
SAXSeekElement integer Searches for the nth element in the node.

To go to the parent node, set the integer to 0 (zero).

SAXSeekElement string Searches for the named element in the node. The string can be one of the following:
  • "/" go to root node
  • "Name" searches in child nodes for named node (element)
  • "*..." special string from SAXGetElementPath


Boolean SAXHasElement integer Checks if a child exists at the nth node.
Boolean SAXHasElement string Checks if a child exists at the named node.
String SAXGetElementPath Returns a special string for later navigation with the SAXSeekElement.

Typekeys Instruction

Description

This list includes all of the keyboard keys that you can use in the typekeys command, provided that you use the following structure:

[control].typekeys "<[key(s)]>"

Examples:

DocumentWriter.TypeKeys "<F11>"

This method allows you to simulate keyboard events such as [ESCape] or [ConTRoL] in the TestTool. For key combinations such as Alt AND F2, use the following structure:

[control].typekeys "<MOD1 F2>"

Ensure that you leave a blank between the keyboard keys.


Value
Key
Value
Key
Value
Key
Characters
Y Y UNDO Undo
0 0 Z Z REPEAT Repeat
1 1
Cursor Keys
FIND Find
2 2 DOWN Cursor down PROPERTIES Properties
3 3 UP Cursor up FRONT Front
4 4 LEFT Cursor left SHIFT Shift
5 5 RIGHT Cursor right MOD1 Ctrl / Strg
6 6 HOME Pos 1 MOD2 Alt
7 7 END End MODTYPE Alt Gr
8 8 PAGEUP Page up F1 F1
9 9 PAGEDOWN Page down F2 F2
A A
Special Keys
F3 F3
B B RETURN Return F4 F4
C C ESCAPE Escape F5 F5
D D TAB Tab F6 F6
E E BACKSPACE Backspace F7 F7
F F SPACE Space / Blank F8 F8
G G INSERT Insert F9 F9
H H DELETE Delete F10 F10
I I
Arithmetic Keys
F11 F11
J J ADD + F12 F12
K K SUBTRACT - F13 F13
L L MULTIPLY * F14 F14
M M DIVIDE : F15 F15
N N POINT . F16 F16
O O COMMA , F17 F17
P P LESS < F18 F18
Q Q GREATER > F19 F19
R R EQUAL = F20 F20
S S
Function Keys
F21 F21
T T OPEN Open F22 F22
U U CUT Cut F23 F23
V V COPY Copy F24 F24
W W PASTE Paste / Insert F25 F25
X X F26 F26

GetMouseStyle

All values of GetMouseStyle command which returns the actual look/state of the cursor.


[nNr] GetMouseStyle


There existing 85 values.


Value
Nr
Comment
ARROW
0
Arrowcursor
NULL
1
WAIT
2
TEXT
3
Entering text
HELP
4
CROSS
5
MOVE
6
Moving objects/images
NSIZE
7
SSIZE
8
WSIZE
9
ESIZE
10
NWSIZE
11
NESIZE
12
SWSIZE
13
SESIZE
14
WINDOW_NSIZE
15
WINDOW_SSIZE
16
WINDOW_WSIZE
17
WINDOW_ESIZE
18
WINDOW_NWSIZE
19
WINDOW_NESIZE
20
WINDOW_SWSIZE
21
WINDOW_SESIZE
22
HSPLIT
23
VSPLIT
24
HSIZEBAR
25
VSIZEBAR
26
HAND
27
REFHAND
28
Links / References
PEN
29
MAGNIFY
30
FILL
31
Fillbox
ROTATE
32
HSHEAR
33
VSHEAR
34
MIRROR
35
CROOK
36
CROP
37
MOVEPOINT
38
MOVEBEZIERWEIGHT
39
MOVEDATA
40
COPYDATA
41
LINKDATA
42
MOVEDATALINK
43
COPYDATALINK
44
MOVEFILE
45
COPYFILE
46
LINKFILE
47
MOVEFILELINK
48
COPYFILELINK
49
MOVEFILES
50
COPYFILES
51
NOTALLOWED
52
DRAW_LINE
53
DRAW_RECT
54
DRAW_POLYGON
55
DRAW_BEZIER
56
DRAW_ARC
57
DRAW_PIE
58
DRAW_CIRCLECUT
59
DRAW_ELLIPSE
60
DRAW_FREEHAND
61
DRAW_CONNECT
62
DRAW_TEXT
63
DRAW_CAPTION
64
CHART
65
DETECTIVE
66
PIVOT_COL
67
PIVOT_ROW
68
PIVOT_FIELD
69
CHAIN
70
CHAIN_NOTALLOWED
71
TIMEEVENT_MOVE
72
TIMEEVENT_SIZE
73
AUTOSCROLL_N
74
AUTOSCROLL_S
75
AUTOSCROLL_W
76
AUTOSCROLL_E
77
AUTOSCROLL_NW
78
AUTOSCROLL_NE
79
AUTOSCROLL_SW
80
AUTOSCROLL_SE
81
AUTOSCROLL_NS
82
AUTOSCROLL_WE
83
AUTOSCROLL_NSWE
84


Resource Types of all Controls and Windows

To see the internal resource type ID for a control or a window (for example, a dialog) in the declaration window, run the declare.bas script in TestTool. You can then use the ID to identify the correct type of control or window to find the corresponding commands. You can also use window.GetRT to determine the resource type ID. The ID for control (324) is often used in OpenOffice.org and represents a special control, such as a treelistbox or a browsbox, that was created by a developer. Use trial and error to determine which commands can be used on a control.


resource type
resource-ID
resource type
resource-ID
BASE
256
FIXEDTEXT
343
MESSBOX
304
FIXEDLINE
344
INFOBOX
305
FIXEDBITMAP
345
WARNINGBOX
306
FIXEDIMAGE
346
ERRORBOX
307
GROUPBOX
348
QUERYBOX
308
SCROLLBAR
349
WINDOW
309
SCROLLBARBOX
350
SYSWINDOW
310
SPLITTER
351
WORKWINDOW
311
SPLITWINDOW
352
FLOATINGWINDOW
313
SPINFIELD
353
DIALOG
314
PATTERNFIELD
354
MODELESSDIALOG
315
NUMERICFIELD
355
MODALDIALOG
316
METRICFIELD
356
SYSTEMDIALOG
317
CURRENCYFIELD
357
PATHDIALOG
318
DATEFIELD
358
FILEDIALOG
319
TIMEFIELD
359
PRINTERSETUPDIALOG
320
PATTERNBOX
360
PRINTDIALOG
321
NUMERICBOX
361
COLORDIALOG
322
METRICBOX
362
FONTDIALOG
323
CURRENCYBOX
363
CONTROL
324
DATEBOX
364
BUTTON
325
TIMEBOX
365
PUSHBUTTON
326
LONGCURRENCYFIELD
366
OKBUTTON
327
LONGCURRENCYBOX
367
CANCELBUTTON
328
TOOLBOX
369
HELPBUTTON
329
DOCKINGWINDOW
370
IMAGEBUTTON
330
STATUSBAR
371
MENUBUTTON
331
TABPAGE
372
MOREBUTTON
332
TABCONTROL
373
SPINBUTTON
333
TABDIALOG
374
RADIOBUTTON
334
BORDERWINDOW
375
IMAGERADIOBUTTON
335
BUTTONDIALOG
376
CHECKBOX
336
SYSTEMCHILDWINDOW
377
TRISTATEBOX
337
FIXEDBORDER
378
EDIT
338
SLIDER
379
MULTILINEEDIT
339
MENUBARWINDOW
380
COMBOBOX
340
TREELISTBOX
381
LISTBOX
341
HELPTEXTWINDOW
382
MULTILISTBOX
342
INTROWINDOW
383

Taken from build environment file: 'res_type'

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools