34.12 Miscellaneous

This section lists the remaining nodes that don't fit in well with any of the other sections.

34.12.1 Comment

This node is similar to a comment line in code. It is primarily used for documentation purposes and can be placed anywhere.

Contained in: Everywhere

Children: None

Execution: Comment nodes do get executed so that they also appear in the run log. Variables are expanded if possible, failing expansion in a comment does not cause an exception.

Attributes:

Comment attributes
Figure 34.66:  Comment attributes
Heading

The string that should get displayed in the tree, a summary of the comment or the comment itself. Minimal HTML styling is supported along with some pseudo tags for colors. The colors red, green, blue and yellow are treated specially and rendered with a color tone matching the current UI theme.

The following HTML tags are passed through:

  • <strong>important text</strong>
  • <b>bold text</b>
  • <em>emphasized text</en>
  • <i>italic Text</i>
  • <u>underlined text</u>
  • <s>strikethrough text</s>
  • <span>some text</span>
  • <font>some text</font>

Colors can be defined in any of the following forms (each in the four supported colors, of course):

  • <span style="color:red">red text</span>
  • <span color="green">green text</span>
  • <font color="blue">blue text</font>
  • <yellow>yellow text</yellow>

Variable: Yes

Restrictions: Must not be empty.

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.2 Error

With the Error node you can write an error to the run log. Use the attributes to specify the information to be written to the run log.

The node can replace scripts containing only rc.logError. It can also replace calls to the procedure qfs.run-log.logError of The standard library.

Contained in: All kinds of sequences.

Children: None

Execution: The Error node writes an error to the run log.

Attributes:

Attributes of the error node
Figure 34.67:  Error attributes
Text

The message text. In the tree node long texts will be truncated.

Variable: Yes

Restrictions: None

Add diagnostic client information

When selected, further information concerning each client process will be written to the run log.

Variable: Yes

Restrictions: None

Print message to terminal also

If active, the message is also written to the QF-Test Terminal.

Variable: Yes

Restrictions: None

Create screenshots

The attribute indicates whether QF-Test should log screenshots to the run log of the whole monitor(s) attached, taking into account the setting of the option Limit screenshots to relevant screens relevant to security and data protection. The default setting of the option only allows screenshots of monitors where either a window of QF-Test or the tested application is showing. By default, in batch mode (no QF-Test GUI) no screenshot will be logged when no SUT window is showing.

Setting Description
Always Always log screenshots to the run log. This may result in memory issues in case a test run has many errors. Options for splitting run logs may be used to reduce memory consumption in such a case.
The option overrules the following settings:
Never Do NOT log screenshots.
Based on options Log and create screenshots depending on the options set. See Options determining run log content for further information.
Variables, for example $(logScreenshots) A reference to a variable containing one of the following values (case insensitive). Depending on the value QF-Test will either always log the screenshots or never or take the options into account.
The following values indicate QF-Test should always log screenshots:
always, 1, true or yes.
The following values indicate QF-Test should never log screenshots:
never, 0, false or no.
The following values indicate QF-Test should decide based on the options:
based on options, options or option.
Table 34.28:  Settings for "Create Screenshots"

Variable: Yes

Restrictions: None

Create client screenshots

The attribute indicates whether QF-Test should log screenshots of all client windows to the run log, even if they may be hidden by other windows.

Setting Description
Always Always log screenshots to the run log. This may result in memory issues in case a test run has many errors. Options for splitting run logs may be used to reduce memory consumption in such a case.
The option overrules the following settings:
Never Do NOT log screenshots.
Based on options Log and create screenshots depending on the options set. See Options determining run log content for further information.
The setting of the option Create screenshots of the client's windows upon error in client is irrelevant, as the node has effect on all clients, just like a Server script.
Variables, for example $(logScreenshots) A reference to a variable containing one of the following values (case insensitive). Depending on the value QF-Test will either always log the screenshots or never or take the options into account.
The following values indicate QF-Test should always log screenshots:
always, 1, true or yes.
The following values indicate QF-Test should never log screenshots:
never, 0, false or no.
The following values indicate QF-Test should decide based on the options:
based on options, options or option.
Table 34.29:  Settings for "Create Client Screenshots"

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.3 Warning

With the Warning node you can write a warning to the run log. Use the attributes to specify the information to be written to the run log.

The node can replace scripts containing only rc.logWarning. It can also replace calls to the procedure qfs.run-log.logWarning of The standard library.

Contained in: All kinds of sequences.

Children: None

Execution: The Warning node writes a warning to the run log.

Attributes:

Attributes of the warning node
Figure 34.68:  Warning attributes
Text

The message text. In the tree node long texts will be truncated.

Variable: Yes

Restrictions: None

Include in report

When this option has been selected, the node will be written to the report.

Variable: Yes

Restrictions: None

Add diagnostic client information

When selected, further information concerning each client process will be written to the run log.

Variable: Yes

Restrictions: None

Print message to terminal also

If active, the message is also written to the QF-Test Terminal.

Variable: Yes

Restrictions: None

Create screenshots

The attribute indicates whether QF-Test should log screenshots to the run log of the whole monitor(s) attached, taking into account the setting of the option Limit screenshots to relevant screens relevant to security and data protection. The default setting of the option only allows screenshots of monitors where either a window of QF-Test or the tested application is showing. By default, in batch mode (no QF-Test GUI) no screenshot will be logged when no SUT window is showing.

Setting Description
Always Always log screenshots to the run log. This may result in memory issues in case a test run has many errors. Options for splitting run logs may be used to reduce memory consumption in such a case.
The option overrules the following settings:
Never Do NOT log screenshots.
Based on options Log and create screenshots depending on the options set. See Options determining run log content for further information. Please note: Screenshots will only be logged when the option Create screenshots for warnings is active.
Variables, for example $(logScreenshots) A reference to a variable containing one of the following values (case insensitive). Depending on the value QF-Test will either always log the screenshots or never or take the options into account.
The following values indicate QF-Test should always log screenshots:
always, 1, true or yes.
The following values indicate QF-Test should never log screenshots:
never, 0, false or no.
The following values indicate QF-Test should decide based on the options:
based on options, options or option.
Table 34.30:  Settings for "Create Screenshots"

Variable: Yes

Restrictions: None

Create client screenshots

The attribute indicates whether QF-Test should log screenshots of all client windows to the run log, even if they may be hidden by other windows.

Setting Description
Always Always log screenshots to the run log. This may result in memory issues in case a test run has many errors. Options for splitting run logs may be used to reduce memory consumption in such a case.
The option overrules the following settings:
Never Do NOT log screenshots.
Based on options Log and create screenshots depending on the options set. See Options determining run log content for further information.
The setting of the option Create screenshots of the client's windows upon error in client is irrelevant, as the node has effect on all clients, just like a Server script.
Please note: Screenshots will only be logged when the option Create screenshots for warnings is active.
Variables, for example $(logScreenshots) A reference to a variable containing one of the following values (case insensitive). Depending on the value QF-Test will either always log the screenshots or never or take the options into account.
The following values indicate QF-Test should always log screenshots:
always, 1, true or yes.
The following values indicate QF-Test should never log screenshots:
never, 0, false or no.
The following values indicate QF-Test should decide based on the options:
based on options, options or option.
Table 34.31:  Settings for "Create Client Screenshots"

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.4 Message

With the Message node you can write a message to the run log. Use the attributes to specify the information to be written to the run log.

The node can replace scripts containing only rc.logMessage. It can also replace calls to the procedure qfs.run-log.logMessage of The standard library.

Contained in: All kinds of sequences.

Children: None

Execution: The Message step writes a message to the run log.

Attributes:

Attributes of the message node
Figure 34.69:  Message attributes
Text

The message text. In the tree node long texts will be truncated.

Variable: Yes

Restrictions: None

Prevent compactification

The option is only relevant when the option Create compact run log has been set to compact run logs. In that case activate the option keep the node in the run log.

Variable: Yes

Restrictions: None

Include in report

When selected, the node will be written to the report.

Variable: Yes

Restrictions: None

Add diagnostic client information

When selected, further information concerning each client process will be written to the run log.

Variable: Yes

Restrictions: None

Print message to terminal also

If active, the message is also written to the QF-Test Terminal.

Variable: Yes

Restrictions: None

Create screenshots

The attribute indicates whether QF-Test should log screenshots to the run log of the whole monitor(s) attached, taking into account the setting of the option Limit screenshots to relevant screens relevant to security and data protection. The default setting of the option only allows screenshots of monitors where either a window of QF-Test or the tested application is showing. By default, in batch mode (no QF-Test GUI) no screenshot will be logged when no SUT window is showing.

Setting Description
Always Always log screenshots to the run log. This may result in memory issues in case a test run has many errors. Options for splitting run logs may be used to reduce memory consumption in such a case.
The option overrules the following settings:
Never Do NOT log screenshots.
Based on options Log and create screenshots depending on the options set. See Options determining run log content for further information.
Variables, for example $(logScreenshots) A reference to a variable containing one of the following values (case insensitive). Depending on the value QF-Test will either always log the screenshots or never or take the options into account.
The following values indicate QF-Test should always log screenshots:
always, 1, true or yes.
The following values indicate QF-Test should never log screenshots:
never, 0, false or no.
The following values indicate QF-Test should decide based on the options:
based on options, options or option.
Table 34.32:  Settings for "Create Screenshots"

Variable: Yes

Restrictions: None

Create client screenshots

The attribute indicates whether QF-Test should log screenshots of all client windows to the run log, even if they may be hidden by other windows.

Setting Description
Always Always log screenshots to the run log. This may result in memory issues in case a test run has many errors. Options for splitting run logs may be used to reduce memory consumption in such a case.
The option overrules the following settings:
Never Do NOT log screenshots.
Based on options Log and create screenshots depending on the options set. See Options determining run log content for further information.
The setting of the option Create screenshots of the client's windows upon error in client is irrelevant, as the node has effect on all clients, just like a Server script.
Variables, for example $(logScreenshots) A reference to a variable containing one of the following values (case insensitive). Depending on the value QF-Test will either always log the screenshots or never or take the options into account.
The following values indicate QF-Test should always log screenshots:
always, 1, true or yes.
The following values indicate QF-Test should never log screenshots:
never, 0, false or no.
The following values indicate QF-Test should decide based on the options:
based on options, options or option.
Table 34.33:  Settings for "Create Client Screenshots"

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.5 Set variable

This node lets you set the value of a global variable. If the test is run interactively from QF-Test and not in batch mode (see "Starting QF-Test") you can optionally set the value interactively.

Contained in: All kinds of sequences.

Children: None

Execution: If the test is run interactively and the Interactive attribute is set, a dialog is shown in which the value for the variable can be entered. If the Timeout is exceeded or the value is confirmed with the OK button, the variable is bound accordingly in the global variables. If the dialog is canceled, the test run is stopped. In the non-interactive case the variable is bound directly to the Default value.

Attributes:

Set variable attributes
Figure 34.70:  Set variable attributes
Variable name

The name of the global variable to which the value is assigned (see "Variables").

Variable: Yes

Restrictions: Must not be empty.

Local variable

This flag determines whether to create a local or global variable binding. If unset, the variable is bound in the global variables. If set, the topmost current binding for the variable is replaced with the new value, provided this binding is within the context of the currently executing Procedure, Dependency or Test case node. If no such binding exists, a new binding is created in the currently executing Procedure, Dependency or Test case node or, if there is no such node in the topmost node on the variables stack, falling back to the global bindings if necessary. See "Variables" for a detailed explanation of variable binding and lookup.

In order to predefine the option use Enable 'Local variable' attribute by default.

Variable: No

Restrictions: None

Default value

The default value for the variable if the test is run non-interactively, the Interactive attribute is not set or the Timeout is exceeded.

Variable: Yes

Restrictions: None

Explicit object type

9.0+ QF-Test variables can contain strings or any other kinds of objects. The text field for the value only accepts string values but this attribute makes it possible to define how QF-Test should interpret the input:

  • No selection: The input will not be further interpreted. In most cases, the stored object will be a String. If the input was completely replaced by the value of another variable by variable expansion, the object will be used without further interpretation.
  • String: The input will be converted into a string.
  • Boolean: The input will be converted into a boolean value. 0, the empty string and the strings false, no and nein will be interpreted as false, other values as true.
  • Number: The input will be converted into a number. Depending on the input, this will be an Integer, Long, BigInteger, Double or a BigDecimal object. If the conversion fails, a ValueCastException will be thrown.
  • Object from JSON: The input will be interpreted as JSON string and converted into nested Maps and Lists with Strings, Numbers, and Booleans. If the conversion fails, a ValueCastException will be thrown.

Interactive

Whether a dialog should be shown in which the value for the global variable can be entered. Ignored if the test is run non-interactively.

Variable: Yes

Restrictions: None

Description

A short description to display in the dialog. If you leave this value empty, the description Value for <Variable name> will be used.

Variable: Yes

Restrictions: None

Timeout

An optional timeout value for the dialog. If the dialog is shown and the value is left unchanged for the specified period of time, the dialog is closed automatically and the default value is used. This avoids blocking a test that is started interactively from QF-Test and then left to run unattended.

Variable: Yes

Restrictions: Empty or > 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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.6 Set image

This node allows you to set the value of an image variable during the runtime of a test. The image variables created with these nodes can then be used in a Check image. For more information, see the section Check image.

The image of the component. It can be displayed at different zoom levels, saved to or loaded from disk in the PNG format, or edited in an external imaging tool. The tool to use must be defined with the option External imaging program.

The text next to the icons displayes the size and the current zoom setting of the image. Furthermore the text next to these icons may also display the current color value of the pixel over which the mouse is positioned. QF-Test may either use the hexadecimal or the rgba format in order to represent the color value. By clicking on this text it is possible to switch between these two representations.

By clicking the $ button above the image, you can assign another image variable or specify a path to an image file.

Contained in: All kinds of sequences.

Children: None

Attributes:

Set variable attributes
Figure 34.71:  Set image Attributes
Variable name

The name of the global variable to which the value is assigned (see "Variables").

Variable: Yes

Restrictions: Must not be empty.

Local variable

This flag determines whether to create a local or global variable binding. If unset, the variable is bound in the global variables. If set, the topmost current binding for the variable is replaced with the new value, provided this binding is within the context of the currently executing Procedure, Dependency or Test case node. If no such binding exists, a new binding is created in the currently executing Procedure, Dependency or Test case node or, if there is no such node in the topmost node on the variables stack, falling back to the global bindings if necessary. See "Variables" for a detailed explanation of variable binding and lookup.

In order to predefine the option use Enable 'Local variable' attribute by default.

Variable: No

Restrictions: None

Image

The image of the component. The display can occur at different zoom levels; the image can be saved to or loaded from a PNG file. Additionally, an external graphic program can be launched to edit the image. This must first be specified using the option External imaging program.

The text next to the icons displays the size and the current zoom level of the image. Additionally, the color value of the pixel under the mouse cursor is shown if the mouse is over the image. The color value can either be displayed in hexadecimal format or in RGBA format, and you can switch between the two representations by clicking on the text.

By clicking the $ button above the image, you can specify an image variable or a path to an image.

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.7 Wait for component to appear

This node is very important for the timing of a test run. The reaction time of the SUT varies depending on system and memory load, so it may take a while until, say, a complex dialog is opened. This node will delay further execution of the test until the desired component or sub-item is available. If the time limit is exceeded without success, a ComponentNotFoundException is thrown. You can also use the Variable for result attribute to store the result into a variable and the Throw exception on failure attribute to suppress the exception.

This node is intended only for relatively long delays. Short delays are handled automatically by the Timeout options.

By setting the Wait for absence attribute this node can also be used to ensure the absence of a component.

Contained in: All kinds of sequences.

Children: None

Execution: The data of the target component are sent to the SUT. The TestEventQueue waits until either the corresponding component becomes available or the time limit is exceeded.

Attributes:

Wait for component attributes
Figure 34.72:  Wait for component to appear attributes
Client

The name of the Java process in which to wait.

Variable: Yes

Restrictions: Must not be empty.

QF-Test component ID

The QF-Test ID of the Window, Component or Item to wait for.

The "Select component" button [Select component] 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.

This attribute supports a special format for referencing components in other test suites (see "Referencing nodes in another test suite"). Furthermore, sub-elements of nodes can be addressed directly without requiring separate nodes for them (see "Sub-items: Addressing relative to a parent component"). When using SmartIDs, you can address a GUI element directly via its recognition criteria. For more information, refer to SmartID and Component nodes versus SmartID.

Variable: Yes

Restrictions: Must not be empty.

Timeout

Time limit in milliseconds.

Variable: Yes

Restrictions: >= 0

Wait for absence

If this attribute is set, QF-Test waits for the absence of a component or a sub-item. This is useful e.g. to ensure that a dialog has been closed or was never opened in the first place. If the component or sub-item remains visible for the whole time, a ComponentFoundException is thrown.

Variable: Yes

Restrictions: None

Variable for result

This optional attribute determines the name for the result variable of the action. If set, the respective variable will be set to 'true' for a successful check or wait and to 'false' in case of failure.

Note If this attribute is set, the attribute Error level of message is ignored and no error is reported. The attribute Throw exception on failure always remains effective, so it is possible to set a result variable and still throw an exception.

Variable: Yes

Restrictions: None

Local variable

This flag determines whether to create a local or global variable binding. If unset, the variable is bound in the global variables. If set, the topmost current binding for the variable is replaced with the new value, provided this binding is within the context of the currently executing Procedure, Dependency or Test case node. If no such binding exists, a new binding is created in the currently executing Procedure, Dependency or Test case node or, if there is no such node in the topmost node on the variables stack, falling back to the global bindings if necessary. See "Variables" for a detailed explanation of variable binding and lookup.

In order to predefine the option use Enable 'Local variable' attribute by default.

Variable: No

Restrictions: None

Error level of message

This attribute determines the error level of the message that is logged in case of failure. Possible choices are message, warning and error.

Note If the attribute Throw exception on failure is set, this attribute is irrelevant and if Variable for result is set this attribute is ignored.

Variable: No

Restrictions: None

Throw exception on failure

Throw an exception in case of failure. For 'Check...' nodes a CheckFailedException is thrown, for 'Wait for...' nodes the respective specific exception.

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.8 Load resources

This node is used to load a ResourceBundle and make its values available for the extended variable syntax ${group:name} (see "External data"). To learn more about ResourceBundles see the description of the ResourceBundle attribute.

Contained in: All kinds of sequences.

Children: None

Execution: The ResourceBundle is loaded and its values are made available under the Group name.

Attributes:

Load resources attributes
Figure 34.73:  Load resources attributes
Group

The name of the group by which values of the ResourceBundle are referred to. The value of a definition of the form name=value in the ResourceBundle can be retrieved with ${group:name} (see "External data").

Variable: Yes

Restrictions: Must not be empty and should not contain special characters like ':' or '$'.

ResourceBundle

The name of the ResourceBundle to load. A little Java background is needed to understand this attribute.

The resources are read with the help of the Java method ResourceBundle.getBundle(). For this to work, a matching file with the extension .class or .properties must be located somewhere on the class path. Use the fully qualified name for the file, including packages, with a dot ('.') as separator, but without extension or locale identifier.

Example: QF-Test comes with a German ResourceBundle in the file de/qfs/apps/qftest/resources/properties/qftest_de.properties, which is contained in the archive qfshared.jar. To load that ResourceBundle, set this attribute to de.qfs.apps.qftest.resources.properties.qftest and the Locale to de.

Variable: Yes

Restrictions: Must name a ResourceBundle on the Java class path.

Locale

The main use of ResourceBundles is to provide data in different languages. This attribute determines, which version of a ResourceBundle is retrieved. The value must follow the ISO standard language_country_variant. Language is a two letter lowercase code like en for English, country a two letter uppercase code like US for American or UK for British English. The variant discriminates further but is rarely used.

As mentioned, QF-Test relies on the Java method ResourceBundle.getBundle() to load the ResourceBundle, which is described in detail in the Java documentation and works as follows:

To load a ResourceBundle named res for the locale en_US, Java first searches the class path for a file named res_en_US.class or res_en_US.properties, then for res_en.class or res_en.properties and finally for res.class and res.properties. The less specific files are loaded even if more specific files are found, but only values not defined in the more specific files are used. That way you can define all English resources in res_en.properties and place only those that differ in res_en_UK.properties and res_en_US.properties.

Unfortunately Java has a "feature" that can lead to surprising results. If no specific file but only the base file res.properties is found, Java tries the whole process a second time, this time for the current default locale of the VM. As a result, if the current locale for QF-Test is German and you want to load English resources that are defined in res.properties and no res_en.properties exists, Java will load the German version from res_de.properties, even if you request the locale en. You can work around this be setting this attribute to the underscore '_'. In that case, only the base file res.properties is loaded.

To use the current locale of the VM, leave this value empty.

Variable: Yes

Restrictions: Empty or valid locale identifier.

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.9 Load properties

This node is used to load data from a Properties file and make its values available for the extended variable syntax ${group:name} (see "External data").

Properties files are easier to handle than ResourceBundles since you request the file directly, but they are less powerful. The format of a Properties file is simple: lines of the form name=value with arbitrary whitespace around the '=' character. Complex definitions spanning multiple lines are possible. Please see the Java documentation for details or ask a developer.

Contained in: All kinds of sequences.

Children: None

Execution: The Properties file is loaded and its values are made available under the Group name.

Attributes:

Load properties attributes
Figure 34.74:  Load properties attributes
Group

The name of the group by which values of the Properties file are referred to. The value of a definition of the form name=value in the Properties file can be retrieved with ${group:name} (see "External data").

Variable: Yes

Restrictions: Must not be empty and should not contain special characters like ':' or '$'.

Properties file

The file to load the Properties from. This can either be an absolute path name or a path relative to the directory of the current suite. In either case you should always use '/' as the separator for directories, even under Windows. QF-Test will translate this to the correct value for the current operating system.

The "..." button brings up a dialog in which you can select the file interactively. You can also get to this dialog by pressing Shift⁠+⁠Return or Alt⁠+⁠Return, when the focus is in the text field.

Variable: Yes

Restrictions: Must be an existing Properties file.

File encoding is UTF-8

Up to Java 8 the class java.util.Properties enforced a file encoding of ISO-Latin-1 for properties files. In Java 9 the default encoding is UTF-8. QF-Test supports both and uses the UTF-8 encoding if this attribute is activated and ISO-Latin-1 otherwise.

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.10 Server HTTP request

This highly specialized node sends a web request via HTTP/HTTPS directly to a web server. Such a request can be very helpful for load tests or mass data computing scenarios (e.g. filling out a form) since the simulation of user interactions and the respective loading time of the SUT are omitted during replay. The use of requests is an enhancement of the functionalities for load tests and data-driven testing described in "Performing GUI-based load tests" and "Data driver".

If the status code returned from the server is 400 or higher, an exception is thrown. This behaviour can be changed using the Error level if status code >= 400 attribute. A detailed description of the different status codes can be found at http://www.w3.org/Protocols/HTTP/HTRESP.html. Additionally, you can store the response from the server in a variable and if the attribute Add server response to run log is active the response is also written to the run log.

Contained in: All kinds of sequences.

Children: None

Execution: The web request is sent directly by QF-Test via HTTP/HTTPS to the specified URL. If the status code returned from the server is >= 400, an exception is thrown. This behaviour can be changed using Error level if status code >= 400 attribute.

Attributes:

Server HTTP Request Attributes
Figure 34.75:  Server HTTP request Attribute
URL

The URL to which to send the request, not including parameters. HTTP and HTTPS are acceptable values for the protocol.

Variable: Yes

Restrictions: Must not be empty.

Method

This attribute defines the method of the request, GET, POST,HEAD, PUT, DELETE, TRACE or CONNECT .

Variable: Yes

Restrictions: None

Parameters

Here you can specify the parameters for the request. The parameters will be URL encoded by QF-Test at execution. See "Tables" for further information how to work with the table.

Variable: Yes

Restrictions: None

Headers

To use custom headers you can set them with this value. You can specify the name of the header and the header value. See "Tables" for further information how to work with the table.

Variable: Yes

Restrictions: None

Additional headers

As an alternative or in addition to the headers table, this field holds additional headers in text form. This makes it easier to use variables and maybe exclude some headers. Each line holds one header in the format Header: Value.

Variable: Ja

Restrictions: Keine

Body

For POST Methods additional payload can be attached to the request. It can be of various types like plain text, JSON or XML. To successfully add the specific format the "Content-Type" header needs to be set to the corresponding value. For more information about the "Content-Type" see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type.

Variable: Yes

Restrictions: None

Variable for HTTP status code

The name of the variable to which the HTTP status code is assigned (see "Variables").

Variable: Yes

Restrictions: None

Response headers

The name of the variable to which the response headers value is assigned (see "Variables").

Variable: Yes

Restrictions: None

Variable for response body

The name of the variable to which the server response is assigned (see "Variables").

Variable: Yes

Restrictions: None

Local variable

This flag determines whether to create local or global variable bindings. If unset, the variables are bound in the global variables. If set, the topmost current binding for a variable is replaced with the new value, provided this binding is within the context of the currently executing Procedure, Dependency or Test case node. If no such binding exists, a new binding is created in the currently executing Procedure, Dependency or Test case node or, if there is no such node in the topmost node on the variables stack, falling back to the global bindings if necessary. See "Variables" for a detailed explanation of variable binding and lookup.

In order to predefine the option use Enable 'Local variable' attribute by default.

Variable: No

Restrictions: None

Add server response to run log

If activated the server response is written to the run log in addition to the status code.

Variable: Yes

Restrictions: None

Save response to file

If set the response is written to this file. This enables QF-Test to download files.

Variable: Yes

Restrictions: QF-Test must be able to write to the file.

Error level if status code >= 400

This attribute can change the error level of requests that return with a status code greater than or equal to 400.

Variable: No

Restrictions: None

Timeout

Time limit in milliseconds until the HTTP Request must succeed. To disable the limit, leave this value empty.

Variable: Yes

Restrictions: Must not be negative.

Error level if time limit exceeded

This attribute determines what happens in case the time limit is exceeded. If set to "exception", a CheckFailedException will be thrown. Otherwise a message with the respective error-level will be logged in the run log.

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None

34.12.11 Unit test

This node is used to execute JUnit tests.

JUnit tests are made for executing unit and integration tests. They should be short and easily repeatable. Unit Tests can be defined in an SUT script or loaded from the SUT or other classpaths.

Contained in: All kinds of sequences.

Children: None

Execution: The required resources and injections are loaded and the test classes are executed step by step.

Attributes:

Unit Test with Server Script attribute
Figure 34.76:  Unit test server attributes
Unit Test with Client Class attribute
Figure 34.77:  Unit test client attributes
Run in Unit Test Execution Environment

Whether to execute the unit tests inside the SUT. If disabled a execution environment is setup for the tests.

Variable: No

Restrictions: None

Client

The name of the SUT client process in which to execute the script.

Variable: Yes

Restrictions: Must not be empty.

Source for the tests

The source for the JUnit tests. This can either be an SUT script or Java classes that are loaded into the SUT.

Script

The script to execute.

Note You may use QF-Test variables of the syntax $(var) or ${group:name} in Jython scripts. They will be expanded before the script is passed to the Jython interpreter. This can lead to unexpected behavior. rc.getStr is the preferred method in this case (see "Accessing variables" for details).

Note In spite of syntax highlighting and automatical indentation this attribute might not be the right place to write complex scripts. 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 scripts can be edited conveniently by pressing Alt⁠+⁠Return or by clicking the External editor button. Complex scripts can also be written as separate modules which can then be imported for use in this attribute. See "Advanced scripting (Jython, Groovy and JavaScript)" for details.

Variable: Yes

Restrictions: Valid syntax

Templates

This dropdown menu contains a list of useful template scripts. The available templates will differ depending on the chosen script type and interpreter.

When you choose one of these templates, the current contents of your script will be replaced.

You can add your own templates to this menu by choosing "Open user templates directory" and placing your template files there. The following file types are valid:

  • [directory]: Will be converted into a submenu.
  • .py: A Jython script template.
  • .groovy: A Groovy script template.
  • .js: A JavaScript script template.

Script language

This attribute determines the interpreter in which to run the script, or in other words, the scripting language to use. Possible values are "Jython", "Groovy" and "JavaScript".

Variable: No

Restrictions: None

Test classes

These are the classes that are executed. They have to be loaded with the defined classpath. They are executed as test steps.

Instead of address the classes by their full name regular expressions can be used.

Test classes can be found if they contain a JUnit 4 Test annotation, if they extend the JUnit 3 unit.org.TestCase or if they contain a RunWith annotation.

You can use one of the following regular expressions:

Regular expression Explanation
**.MainTest All MainTest classes in all packages.
de.qfs.test.* All test-classes from the de.qfs.test package.
de.qfs.**.* All test classes from all sub packages of de.qfs.
Table 34.34:  Possible regular expressions

NoteDuring the search of the test classes all classes in the given directory are loaded. The statement **.* loads all classes in the classpath and their static initializers. So this should be used carefully.

Variable: Yes

Restrictions: The class has to be loaded.

Classpath

Files and folders to load for the execution of the Unit Test.

Variable: Yes

Restrictions: The path has to be valid.

Injections

Injections enable working with Objects from QF-Test inside the tests.

Type Description
String QF-Test variables or direct values.
Component Components of QF-Test.
WebDriver WebDriver objects of the current browser.
Table 34.35:  Injection types

Note The value of 'field' can be left empty. In this case the default value instance is used.

Variable: Yes

Restrictions: Object has to be available.

GUI engine

The GUI engine in which to execute the unit test. Only relevant for SUTs with more than one GUI engine as described in "GUI engines".

Variable: Yes

Restrictions: See "GUI engines"

Name

The name of a Unit test is a kind of short description. It is displayed in the tree view, so it should be concise and say something about the function of the script.

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 External editor button.

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

If you enter text in the comment field of a Component node, the node will be considered as 'used' when you want to mark or delete unused components.

Variable: Yes

Restrictions: None