Manual | Tutorial | Standard Library | Release Notes

Release Notes

37.8
Events

This section lists all kinds of nodes that trigger actions in the SUT. Besides true Java events these include pseudo events with special behavior.

37.8.1
'Mouse event'

'Mouse events' simulate mouse movement and clicks as well as drag and drop operations.

Contained in: All kinds of sequences.

Children: None

Execution: The coordinates and other attributes of the event are sent to the SUT together with the data about the target component. The TestEventQueue determines the corresponding component in the SUT, adjusts the coordinates and triggers the resulting event.

Attributes:

Mouse event attributes
Figure 37.48:  'Mouse event' attributes
'Client'

The name of the SUT client process to which the event is sent.

Variable: Yes

Restrictions: Must not be empty.

'QF-Test component ID'

The 'QF-Test ID' of the 'Window', 'Component' or 'Item' node that is the target of the event.

The button brings up a dialog in which you can select the component interactively. You can also get to this dialog by pressing [Shift-Return] or [Alt-Return], when the focus is in the text field. As an alternative you can copy the target node with [Ctrl-C] or »Edit«-»Copy« and insert its QF-Test component ID into the text field by pressing [Ctrl-V].

By using a special syntax you can target 'Items' directly or access components from another suite (see section 6.3 and section 20.1 for details).

Variable: Yes

Restrictions: Must not be empty.

'Event'

This ComboBox lets you choose the type of the event. MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_CLICKED and MOUSE_DRAGGED are the standard event IDs of the Java class MouseEvent.

The abstract 'Mouse click' event is a compound of the events MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED and MOUSE_CLICKED. During replay the pseudo event is simulated as four separate events. This adds to the clarity of a test-suite and simplifies editing.

4.1.3+ The special 'Double click' event comprises all the individual events required to simulate a complete double click.

The events MOUSE_DRAG_FROM, MOUSE_DRAG_OVER and MOUSE_DROP_TO are used to simulate Drag&Drop in the SUT. See section 43.1 for details.

Variable: No

Restrictions: None

X/Y

These are the coordinates of the MouseEvent. They are relative to the upper left corner of the 'Window', 'Component' or 'Item' that is the target of the event. They can be negative, e.g. to simulate a click on the expansion toggle of a node in a JTree.

Most of the time the exact coordinates for a mouse don't really matter, any place within the target will do. In this case you should leave the 'X' and 'Y' values empty to tell QF-Test to aim at the center of the target. Where possible QF-Test will leave the values empty when recording, provided the option Record MouseEvents without coordinates where possible is active.

Variable: Yes

Restrictions: Valid number or empty

'Modifiers'

This value reflects the state of the mouse buttons and the modifier keys [Shift], [Control], [Alt] and [Meta] during a mouse or key event. States are combined by adding up their values.

Value Key/Button
1 Shift
2 Control
4 Meta or right mouse button
8 Alt or middle mouse button
16 Left mouse button
Table 37.16:  Modifier values

Variable: Yes

Restrictions: Valid number

'Click count'

This value lets a Java program distinguish between a single and a double (or even multiple) click.

Variable: Yes

Restrictions: Valid number

'Popup trigger'

If this attribute is set, the event can trigger a PopupMenu. This is Java's somewhat peculiar way of supporting different conventions for triggering PopupMenus on different platforms.

Variable: Yes

Restrictions: None

'Replay as "hard" event'

If this attribute is set the event is replayed as a hard event, meaning it is triggered as a real system event that moves the mouse around and not just inserted as soft event into the event queue. Soft events are are typically better because they avoid impact of concurrent user mouse actions and are less likely to break due to interference from an overlapping window. Nevertheless there are certain special situations where hard events are helpful.

Variable: Yes

Restrictions: None

'QF-Test ID'

At the moment the 'QF-Test ID' attribute has no meaning for this type of node.

Variable: No

Restrictions: Must not contain any of the characters '\', '#', '$', '@', '&', or '%' or start with an underscore ('_').

'Delay before/after'

These attributes cause a delay before or after the execution of the node. If a value is empty, the Default delay from the global options is used.

Variable: Yes

Restrictions: Valid number >= 0

'Comment'

Here you can enter a comment that explains the purpose of this node. This is the preferred way of documenting the test-suite.

Note For detailed documentation, especially for 'Test-set', 'Test-case' or 'Procedure' nodes, this text area might not be the right place. There are many excellent editors that are much better suited to this task. The option External editor command lets you define an external editor in which comments can be edited conveniently by pressing [Alt-Return] or by clicking the Edit row button.

You can trigger a special behavior of some nodes using doctags, please see Doctags.

Variable: Yes

Restrictions: None

37.8.2
'Key event'

'Key events' simulate keyboard input in the SUT. These are used mainly for control and function keys. Input of text is better represented as a 'Text input'.

The special keyboard event InputMethodEvent supports international character codes. QF-Test doesn't support InputMethodEvents directly. Instead, it converts events of type INPUT_METHOD_TEXT_CHANGED into 'Key events' of type KEY_TYPED.

Contained in: All kinds of sequences.

Children: None

Execution: The key codes of the event are sent to the SUT together with the data about the target component. The TestEventQueue determines the corresponding component in the SUT and triggers the resulting event.

Attributes:

Key event attributes
Figure 37.49:  'Key event' attributes
'Client'

The name of the SUT client process to which the event is sent.

Variable: Yes

Restrictions: Must not be empty.

'QF-Test component ID'

The 'QF-Test ID' of the 'Window', 'Component' or 'Item' node that is the target of the event.

The button brings up a dialog in which you can select the component interactively. You can also get to this dialog by pressing [Shift-Return] or [Alt-Return], when the focus is in the text field. As an alternative you can copy the target node with [Ctrl-C] or »Edit«-»Copy« and insert its QF-Test component ID into the text field by pressing [Ctrl-V].

By using a special syntax you can target 'Items' directly or access components from another suite (see section 6.3 and section 20.1 for details).

Variable: Yes

Restrictions: Must not be empty.

'Event'

This ComboBox lets you choose the type of the event. KEY_PRESSED, KEY_TYPED and KEY_RELEASED are the standard event IDs of the Java class KeyEvent.

The 'Keystroke' pseudo event is a compound of the events KEY_PRESSED, KEY_TYPED and KEY_RELEASED. During replay the pseudo event is simulated as two or three separate events, depending on whether it is a printable character key, or a control or function key. In the latter case, no KEY_TYPED event is generated.

Variable: No

Restrictions: None

'Key'

This is a convenience method to set 'Key code', 'Key char' and 'Modifiers' directly by pressing the corresponding key while this component has the keyboard focus. For KEY_TYPED events 'Key char' is set to 0.

Unfortunately you can't select the [Tab] key this way since it is used for keyboard traversal. 'Key code' and 'Key char' for the [Tab] key are both 9.

Variable: No

Restrictions: None

'Key code'

This is a Java specific code for the key, the keyCode member of the Java class KeyEvent.

Variable: Yes

Restrictions: Valid number

'Key char'

This is the keyChar member of the Java class KeyEvent. Its value is the character generated created by the last key press, taking the state of the [Shift] key into account. Control and function keys always have a 'Key char' value of 65535.

Variable: Yes

Restrictions: Valid number

'Modifiers'

This value reflects the state of the mouse buttons and the modifier keys [Shift], [Control], [Alt] and [Meta] during a mouse or key event. States are combined by adding up their values.

Value Key/Button
1 Shift
2 Control
4 Meta or right mouse button
8 Alt or middle mouse button
16 Left mouse button
Table 37.17:  Modifier values

Variable: Yes

Restrictions: Valid number

'QF-Test ID'

At the moment the 'QF-Test ID' attribute has no meaning for this type of node.

Variable: No

Restrictions: Must not contain any of the characters '\', '#', '$', '@', '&', or '%' or start with an underscore ('_').

'Delay before/after'

These attributes cause a delay before or after the execution of the node. If a value is empty, the Default delay from the global options is used.

Variable: Yes

Restrictions: Valid number >= 0

'Comment'

Here you can enter a comment that explains the purpose of this node. This is the preferred way of documenting the test-suite.

Note For detailed documentation, especially for 'Test-set', 'Test-case' or 'Procedure' nodes, this text area might not be the right place. There are many excellent editors that are much better suited to this task. The option External editor command lets you define an external editor in which comments can be edited conveniently by pressing [Alt-Return] or by clicking the Edit row button.

You can trigger a special behavior of some nodes using doctags, please see Doctags.

Variable: Yes

Restrictions: None

37.8.3
'Text input'

This is a pseudo event for simulating text input from the keyboard. A single 'Text input' node replaces a whole sequence of 'Key event' nodes. To achieve this, QF-Test takes advantage of the fact that AWT and Swing text fields listen only to KEY_TYPED events, so input of text can be simulated by triggering one KEY_TYPED event per text character. If your SUT uses custom text components that actually require the KEY_PRESSED and KEY_RELEASED events, you cannot use this node type but have to resort to plain 'Key events'.

Contained in: All kinds of sequences.

Children: None

Execution: The text is sent to the SUT together with the data about the target component. The TestEventQueue determines the corresponding component in the SUT and triggers the resulting events.

Attributes:

Text input attributes
Figure 37.50:  'Text input' attributes
'Client'

The name of the SUT client process to which the event is sent.

Variable: Yes

Restrictions: Must not be empty.

'QF-Test component ID'

The 'QF-Test ID' of the 'Window', 'Component' or 'Item' node that is the target of the event.

The button brings up a dialog in which you can select the component interactively. You can also get to this dialog by pressing [Shift-Return] or [Alt-Return], when the focus is in the text field. As an alternative you can copy the target node with [Ctrl-C] or »Edit«-»Copy« and insert its QF-Test component ID into the text field by pressing [Ctrl-V].

By using a special syntax you can target 'Items' directly or access components from another suite (see section 6.3 and section 20.1 for details).

Variable: Yes

Restrictions: Must not be empty.

'Text'

The text that is to be sent to the SUT.

Note When inserting text into a password field it may be desirable to avoid having the password show up as plain text in the test-suite or a run-log. To that end the password can be encrypted by inserting the plain-text password, right-clicking and selecting »Crypt password« from the popup menu. Please be sure to specify a password salt before encrypting via the option Salt for crypting passwords.

Variable: Yes

Restrictions: No line breaks are possible.

'Clear target component first'

If this attribute is set, and the target component is a text field or text area, the contents of the target component are removed before the new text is inserted.

Variable: Yes

Restrictions: None

'Replay single events'

If the target component is a text field or a text area, the text can optionally be inserted by manipulating the component directly through its API. This is much faster, but if KeyListeners are registered on the component they will not be notified of the change. If this attribute is set, key events are simulated for every single character.

Variable: Yes

Restrictions: None

'QF-Test ID'

At the moment the 'QF-Test ID' attribute has no meaning for this type of node.

Variable: No

Restrictions: Must not contain any of the characters '\', '#', '$', '@', '&', or '%' or start with an underscore ('_').

'Delay before/after'

These attributes cause a delay before or after the execution of the node. If a value is empty, the Default delay from the global options is used.

Variable: Yes

Restrictions: Valid number >= 0

'Comment'

Here you can enter a comment that explains the purpose of this node. This is the preferred way of documenting the test-suite.

Note For detailed documentation, especially for 'Test-set', 'Test-case' or 'Procedure' nodes, this text area might not be the right place. There are many excellent editors that are much better suited to this task. The option External editor command lets you define an external editor in which comments can be edited conveniently by pressing [Alt-Return] or by clicking the Edit row button.

You can trigger a special behavior of some nodes using doctags, please see Doctags.

Variable: Yes

Restrictions: None

37.8.4
'Window event'

WindowEvents are of limited use for a test-suite since most of them are not generated as a direct consequence of some user interaction. The only exception is the WINDOW_CLOSING event that is triggered when the user closes a window. It is also possible to simulate WINDOW_ICONIFIED and WINDOW_DEICONIFIED events.

Contained in: All kinds of sequences.

Children: None

Execution: The event is sent to the SUT together with the data about the target window. The TestEventQueue determines the corresponding window in the SUT and triggers the resulting event.

Attributes:

Window event attributes
Figure 37.51:  'Window event' attributes
'Client'

The name of the SUT client process to which the event is sent.

Variable: Yes

Restrictions: Must not be empty.

'QF-Test component ID'

The 'QF-Test ID' of the 'Window', 'Component' or 'Item' node that is the target of the event.

The button brings up a dialog in which you can select the component interactively. You can also get to this dialog by pressing [Shift-Return] or [Alt-Return], when the focus is in the text field. As an alternative you can copy the target node with [Ctrl-C] or »Edit«-»Copy« and insert its QF-Test component ID into the text field by pressing [Ctrl-V].

By using a special syntax you can target 'Items' directly or access components from another suite (see section 6.3 and section 20.1 for details).

Variable: Yes

Restrictions: Must not be empty.

'Event'

This ComboBox lets you choose the type of the event. Possible values are WINDOW_OPENED, WINDOW_CLOSING, WINDOW_CLOSED, WINDOW_ACTIVATED, WINDOW_DEACTIVATED, WINDOW_ICONIFIED and WINDOW_DEICONIFIED, the standard event IDs of the Java class WindowEvent.

Variable: No

Restrictions: None

'QF-Test ID'

At the moment the 'QF-Test ID' attribute has no meaning for this type of node.

Variable: No

Restrictions: Must not contain any of the characters '\', '#', '$', '@', '&', or '%' or start with an underscore ('_').

'Delay before/after'

These attributes cause a delay before or after the execution of the node. If a value is empty, the Default delay from the global options is used.

Variable: Yes

Restrictions: Valid number >= 0

'Comment'

Here you can enter a comment that explains the purpose of this node. This is the preferred way of documenting the test-suite.

Note For detailed documentation, especially for 'Test-set', 'Test-case' or 'Procedure' nodes, this text area might not be the right place. There are many excellent editors that are much better suited to this task. The option External editor command lets you define an external editor in which comments can be edited conveniently by pressing [Alt-Return] or by clicking the Edit row button.

You can trigger a special behavior of some nodes using doctags, please see Doctags.

Variable: Yes

Restrictions: None

37.8.5
'Component event'

The name 'Component event' for this node may be misleading, since QF-Test filters all of these events except for windows, but since they represent the Java class ComponentEvent, it is better to stick to that name. Except for COMPONENT_MOVED and COMPONENT_SIZED events on a window, which are the result of the user moving or resizing the window interactively, all ComponentEvents are artificial and thus ignored.

Contained in: All kinds of sequences.

Children: None

Execution: The event is sent to the SUT together with the data about the target window. The TestEventQueue determines the corresponding window in the SUT and triggers the resulting event.

Attributes:

Component event attributes
Figure 37.52:  'Component event' attributes
'Client'

The name of the SUT client process to which the event is sent.

Variable: Yes

Restrictions: Must not be empty.

'QF-Test component ID'

The 'QF-Test ID' of the 'Window', 'Component' or 'Item' node that is the target of the event.

The button brings up a dialog in which you can select the component interactively. You can also get to this dialog by pressing [Shift-Return] or [Alt-Return], when the focus is in the text field. As an alternative you can copy the target node with [Ctrl-C] or »Edit«-»Copy« and insert its QF-Test component ID into the text field by pressing [Ctrl-V].

By using a special syntax you can target 'Items' directly or access components from another suite (see section 6.3 and section 20.1 for details).

Variable: Yes

Restrictions: Must not be empty.

'Event'

This ComboBox lets you choose the type of the event. Possible values are COMPONENT_SIZED and COMPONENT_MOVED, the standard event IDs of the Java class ComponentEvent.

Variable: No

Restrictions: None

'Y/Height'

For a COMPONENT_MOVED event set this to the new Y-coordinate of the window, for a COMPONENT_SIZED event to its new height.

Variable: Yes

Restrictions: Valid number, height > 0

'X/Width'

For a COMPONENT_MOVED event set this to the new X-coordinate of the window, for a COMPONENT_SIZED event to its new width.

Variable: Yes

Restrictions: Valid number, width > 0

'QF-Test ID'

At the moment the 'QF-Test ID' attribute has no meaning for this type of node.

Variable: No

Restrictions: Must not contain any of the characters '\', '#', '$', '@', '&', or '%' or start with an underscore ('_').

'Delay before/after'

These attributes cause a delay before or after the execution of the node. If a value is empty, the Default delay from the global options is used.

Variable: Yes

Restrictions: Valid number >= 0

'Comment'

Here you can enter a comment that explains the purpose of this node. This is the preferred way of documenting the test-suite.

Note For detailed documentation, especially for 'Test-set', 'Test-case' or 'Procedure' nodes, this text area might not be the right place. There are many excellent editors that are much better suited to this task. The option External editor command lets you define an external editor in which comments can be edited conveniently by pressing [Alt-Return] or by clicking the Edit row button.

You can trigger a special behavior of some nodes using doctags, please see Doctags.

Variable: Yes

Restrictions: None

37.8.6
'Selection'

A 'Selection' node represents an abstract event like selecting a menu item, choosing an entry in a combo box or selecting something from or closing a system dialog. Currently this event node is used only for SWT and web SUT clients, where some events cannot be triggered by "soft" mouse events, . The alternative of using "hard" events has some disadvantages as described for the 'Replay as "hard" event' attribute of a 'Mouse event'.

The 'Detail' attribute determines the kind of operation to perform, or the value to select, depending on the target component.

SWT The following combinations of widgets and 'Detail' values are currently supported for SWT:

Class 'Detail' attribute Action
CCombo sub-item Empty Choose item as current value
ColorDialog Color value in hexadecimal #rrggbb format Select given color
ColorDialog CANCEL Abort color selection
Combo sub-item Empty Choose item as current value
CTabFolder sub-item Empty Select tab
CTabFolder sub-item close Close tab
DirectoryDialog Directory name Select given directory
DirectoryDialog CANCEL Abort directory selection
FileDialog File name, including directory Select given file
FileDialog CANCEL Abort file selection
FontDialog Font description, system specific Select given font
FontDialog CANCEL Abort file selection
Menu close Cancel the menu (close without selection)
MenuItem Empty Select item
MessageBox Any of OK YES NO CANCEL ABORT RETRY IGNORE OPEN SAVE Close with the given value as the user's choice
ProgressBar ProgressBar value Set the given value
Scale Scale value Set the given value
Slider Slider value Set the given value
Spinner Spinner value Set the given value
TabFolder sub-item Empty Select tab
Table 37.18:  Supported SWT widgets for a 'Selection' event

Note Eclipse/RCP makes heavy use of dynamic CTabFolders where the items can be moved between folders. The items represent the actual business objects whereas the folders are just scaffolding to hold them. Besides, the layout of the folders and items can change drastically when switching perspectives. Thus it is often desirable to be able to select or close an item independent of the CTabFolder it currently resides in. This can be done by using the 'Procedures' qfs.qft#qfs.swt.ctabfolder.selectTab and qfs.qft#qfs.swt.ctabfolder.closeTab, provided in the qfs.qft standard library. Besides the ubiquitous client parameter, the only other parameter tabname must be set to the name of the item to select or close.

Web The following combinations of DOM nodes and 'Detail' values are currently supported for web SUT clients:

Node type 'Detail' attribute Action
Confirmation dialog Any of OK YES NO CANCEL RETRY Close the dialog with the given value as the user's choice
File dialog for download The file to save to or CANCEL Close the dialog and save to the specified file or abort the download
Login dialog Username|Password or CANCEL Close the dialog and login with the specified data or abort. The password can by encrypted by right-clicking the 'Detail' field and selecting »Crypt password«. Please be sure to specify a password salt before encrypting via the option Salt for crypting passwords.
Prompt dialog The text to enter or CANCEL Close the dialog and return the specified text or abort
Top-level <DOCUMENT> back Navigate back to the previous page
Top-level <DOCUMENT> forward Navigate forward to the next page
Top-level <DOCUMENT> goto:URL Navigate to the specified URL
Top-level <DOCUMENT> refresh Reload the current page
Top-level <DOCUMENT> stop Stop loading the current page
<OPTION> or <SELECT> sub-item 0 Choose the <OPTION> as current value
<OPTION> or <SELECT> sub-item 1 Add the <OPTION> to the selection
<OPTION> or <SELECT> sub-item -1 Remove the <OPTION> from the selection
Table 37.19:  Supported DOM nodes for a 'Selection' event

Contained in: All kinds of sequences.

Children: None

Execution: The event is sent to the SUT together with the data about the target component. The component is resolved and an action performed which depends on the type of component as listed in the table above.

Attributes:

Mouse event attributes
Figure 37.53:  'Selection' attributes
'Client'

The name of the SUT client process to which the event is sent.

Variable: Yes

Restrictions: Must not be empty.

'QF-Test component ID'

The 'QF-Test ID' of the 'Window', 'Component' or 'Item' node that is the target of the event.

The button brings up a dialog in which you can select the component interactively. You can also get to this dialog by pressing [Shift-Return] or [Alt-Return], when the focus is in the text field. As an alternative you can copy the target node with [Ctrl-C] or »Edit«-»Copy« and insert its QF-Test component ID into the text field by pressing [Ctrl-V].

By using a special syntax you can target 'Items' directly or access components from another suite (see section 6.3 and section 20.1 for details).

Variable: Yes

Restrictions: Must not be empty.

'Detail'

The 'Detail' attribute specifies the kind of operation to perform or the value to select, depending on the target component. The possible combinations are listed in detail above.

Variable: Yes

Restrictions: None

'QF-Test ID'

At the moment the 'QF-Test ID' attribute has no meaning for this type of node.

Variable: No

Restrictions: Must not contain any of the characters '\', '#', '$', '@', '&', or '%' or start with an underscore ('_').

'Delay before/after'

These attributes cause a delay before or after the execution of the node. If a value is empty, the Default delay from the global options is used.

Variable: Yes

Restrictions: Valid number >= 0

'Comment'

Here you can enter a comment that explains the purpose of this node. This is the preferred way of documenting the test-suite.

Note For detailed documentation, especially for 'Test-set', 'Test-case' or 'Procedure' nodes, this text area might not be the right place. There are many excellent editors that are much better suited to this task. The option External editor command lets you define an external editor in which comments can be edited conveniently by pressing [Alt-Return] or by clicking the Edit row button.

You can trigger a special behavior of some nodes using doctags, please see Doctags.

Variable: Yes

Restrictions: None

37.8.7
'File selection'

A 'File selection' is a pseudo event that you only need in a special case.

If your SUT uses the standard AWT file selection dialog, implemented by the class java.awt.FileDialog, QF-Test has no chance to record the events the user generates while selecting a file, since they are all handled by the underlying system and never passed on to Java. For the same reason, the selection cannot be simulated as a sequence of mouse and key events. This is not the case with Swing's javax.swing.JFileChooser which is implemented as a normal dialog.

Therefore QF-Test just records the result of the file selection in the form of this node and stores that data in the FileDialog upon replay before closing it. For the SUT there is no difference to an actual selection by the user.

Contained in: All kinds of sequences.

Children: None

Execution: File and directory are stored in an open java.awt.FileDialog and the dialog is closed.If no FileDialog is open, a ComponentNotFoundException is thrown.

Attributes:

File selection attributes
Figure 37.54:  'File selection' attributes
'Client'

The name of the SUT client process to which the event is sent.

Variable: Yes

Restrictions: Must not be empty.

'File'

The name of the file (without the directory part) that is to be selected.

Variable: Yes

Restrictions: Must not be empty

'Directory'

The directory of the file that is to be selected.

Variable: Yes

Restrictions: Must not be empty

'GUI engine'

The GUI engine in which to look for a file selection dialog. Only relevant for SUTs with more than one GUI engine as described in chapter 40.

Variable: Yes

Restrictions: See chapter 40

'QF-Test ID'

At the moment the 'QF-Test ID' attribute has no meaning for this type of node.

Variable: No

Restrictions: Must not contain any of the characters '\', '#', '$', '@', '&', or '%' or start with an underscore ('_').

'Delay before/after'

These attributes cause a delay before or after the execution of the node. If a value is empty, the Default delay from the global options is used.

Variable: Yes

Restrictions: Valid number >= 0

'Comment'

Here you can enter a comment that explains the purpose of this node. This is the preferred way of documenting the test-suite.

Note For detailed documentation, especially for 'Test-set', 'Test-case' or 'Procedure' nodes, this text area might not be the right place. There are many excellent editors that are much better suited to this task. The option External editor command lets you define an external editor in which comments can be edited conveniently by pressing [Alt-Return] or by clicking the Edit row button.

You can trigger a special behavior of some nodes using doctags, please see Doctags.

Variable: Yes

Restrictions: None