Deprecated nodes
The following nodes have been replaced by newer node types. The nodes can still be executed, but you shouldn't use them anymore.
Test
|
Note Before QF-Test version 2 the Test node was one of the main building blocks of a test suite. It had a few shortcomings however: Its setup/cleanup structure was too linear and inflexible for complex scenarios and it was never clear whether a Test node represented a logical test case or was just used to implement some sequence. Thus Test nodes have been replaced with Test set and Test case nodes. A Test is a special Sequence that executes extra setup and cleanup code before and after the execution of its child nodes to ensure that each of the children runs under similar conditions and to prevent unwanted side effects between the execution of one child and the next. To do so, a Test has two special, optional child nodes besides its normal children, a Setup as the first and a Cleanup as the last node. With its Implicitly catch exceptions attribute a Test also offers special exception handling to prevent exceptions in one Test from aborting a whole test run. For special cases of data driven testing a Test may also contain a Data driver, whereas such is typically done in combination with Test sets as described in chapter 23. That functionality can be achieved by using Test step nodes. For backwards compatibility and to ease transition from old-style Test nodes to Test set and Test case nodes QF-Test treats nodes as a Test set or Test case for documentation and report if their place in the hierarchy allows it. In some cases Test nodes have been treated as Test step nodes, e.g. if data-driven test steps have been used. Old test suites with a structure based on Test nodes can by migrated to make use of the new features of Test sets and Test cases. To this end, right-click on a Test node to bring up the context menu. If a transformation is allowed, QF-Test will offer to transform the Test node into a Test set, Test case or Test step node. 3.0+ It is possible to convert a whole hierarchy of Test nodes to a hierarchy of Test set and Test case nodes by selecting the recursive conversion option in the popup menu. Note Both Test set and Test case nodes may contain Setup or Cleanup nodes for backwards compatibility. In a Test set, these work just as in a Test: Setup and Cleanup are executed for each test contained in the Test set. In a Test case however, Setup and Cleanup are only run once at the beginning and end of its execution. If a Test set or Test case has both a Dependency and Setup/Cleanup nodes, the Dependency will be executed first. Setup and Cleanup will have no impact on the dependency stack described in subsection 8.6.3. |
Contained in: All kinds of sequences.
Children: Optional Data driver followed by an optional Setup at the beginning, then any kind of executable nodes and an optional Cleanup as last node.
Execution: The Variable definitions of the Test are bound. If there is a Data driver node, it is executed to create a data driving context and bind one or more Data binders for iteration over the determined data sets as described in chapter 23. For each of its normal child nodes, the Setup is executed, then the child and then the Cleanup. After the last execution of the Cleanup is complete, the variables are unbound again.
Attributes:

- Name
-
The name of a sequence 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 sequence.
Variable: No
Restrictions: None
- Name for separate run log
-
If this attribute is set it marks the node as a breaking point for split run logs and defines the filename for the partial log. When the node finishes, the respective log entry is removed from the main run log and saved as a separate, partial run log. This operation is completely transparent, the main run log retains references to the partial logs and is fully controllable. Please see subsection 7.1.6 for further information about split run logs.
This attribute has no effect if the option Create split run logs is disabled or split run logs are explicitly turned off for batch mode via the
-splitlog
command line argument.There is no need to keep the filename unique. If necessary, QF-Test appends a number to the filename to avoid collisions. The filename may contain directories and, similar to specifying the name of a run log in batch mode on the command line, the following placeholders can be used after a '%' or a '+' character:
Character Replacement % Literal '%' character. + Literal '+' character. i The current runid as specified with -runid <ID>
.r The error level of the partial log. w The number of warnings in the partial log. e The number of errors in the partial log. x The number of exceptions in the partial log. t The thread index to which the partial log belongs (for tests run with parallel threads). y The current year (2 digits). Y The current year (4 digits). M The current month (2 digits). d The current day (2 digits). h The current hour (2 digits). m The current minute (2 digits). s The current second (2 digits). Table 42.40: Placeholders for the Name for separate run log attribute Variable: Yes
Restrictions: None, characters that are illegal for a filename will be replaced with '_'.
- Variable definitions
-
This is where you define the values of the variables that remain bound during the execution of the sequence's child nodes (see chapter 6). See subsection 2.2.5 about how to work with the table.
Variable: Variable names no, values yes
Restrictions: None
- Implicitly catch exceptions
-
When an exception is thrown during the execution of one of the Test's normal child nodes, the Test is usually terminated prematurely. This may not be what you want, since no information is gained from the execution of the rest of the child nodes.
If the Setup and Cleanup of the test are set up so you can guarantee the same initial conditions for each child node even in the case of an exception, you can set this attribute to make the Test catch the exception implicitly. That way, if an exception is caught from a normal child node, the exception is logged and the execution of that child node is stopped. Then the Test continues with the Cleanup as if nothing had happened.
Exceptions thrown during the execution of either the Setup or the Cleanup cannot be caught that way and will always terminate the Test
Variable: No
Restrictions: None
- Maximum error level
-
When a warning, error or exception occurs during a test run, the state of the corresponding node of the run log is set accordingly. This state is normally propagated to the parent node in a way that ensures that the error state of a run log node represents the worst of its child nodes' states. Using this attribute, the maximum error state that the run log node for a sequence will propagate, can be limited.
Note This value has no effect on the way exceptions are handled. It only affects the error states of the run log nodes and by that the exit code of QF-Test when run in batch mode (see. section 1.7). It also has no effect on the creation of compact run logs (see command line argument
-compact
). The node for a sequence in which a warning, error or exception occurs is never removed from a compact log, even if the error is not propagated due to the setting of this attribute.Variable: No
Restrictions: None
- Execution timeout
-
Time limit for the node's execution in milliseconds. If that limit expires the execution of that node will get interrupted.
Variable: Yes
Restrictions: >= 0
- QF-Test ID
-
When using the command line argument
-test <n>|<ID>
for execution in batch mode you can specify the QF-Test ID of the node as an alternative to its qualified name.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
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
Procedure installCustomWebResolver
Until QF-Test 7, the mapping of HTML objects to QF-Test components was done via the procedure
qfs.web.ajax.installCustomWebResolver
from the standard library qfs.qft
.
It has been replaced by the Install CustomWebResolver node.

The sections installCustomWebResolver
- Parameters and
installCustomWebResolver
- Parameter syntax
explain the parameters and the syntax of the procedure.
installCustomWebResolver
- Parameters
The parameters are sorted by relevance. So, for example,
as component recognition is mostly based on determining QF-Test generic class names
from CSS classes or other attributes the parameters genericClasses
and attributesToGenericClasses
come first.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
installCustomWebResolver
- Parameter syntax
If a parameter can take more than one entry you need to separate the entries by commas. The comma may be followed by a line break, however, not by a space.
The parameter syntax consists of the following expressions, sorted by relevance:
- %
-
%
denotes the following string as a regular expression.%list.*
refers to all values starting withlist
Can be used with all parameters.
-
css-class
=generic class
-
Maps an HTML element with the given css class to a QF-Test component of the given generic class.
css-button=Button
maps an HTML element with the css classcss-button
to a QF-Test component of the generic classButton
.Can be used with the parameter
genericClasses
. -
attribute
=value
=generic class
-
Maps an HTML element with the given attribute value to a QF-Test component with the given generic class.
role=datatable=Table
assigns the generic QF-Test classTable
if the attributerole
has the valuedatatable
.Can be used with the parameter
attributesToGenericClasses
. -
TAG
=generic class
-
Maps an HTML element with the given tag to a QF-Test component of the given generic class. Tags have to be written in capital letters.
LI=ListItem
maps the HTML element with the tagli
to a QF-Test component with the generic classListItem
.Can be used with the parameter
tagsToGenericClasses
. - @::ancestor=
class name or TAG
-
Suffix to entries in the parameter lists. The entry will only be evaluated when one of the ancestors of the GUI element has the given class name or the given tag. Please use capital letters for the tag.
Can be used with all parameters.
Sample for parameter
tagsToGenericClasses
:LI=TableCell@::ancestor=TableRow
maps an HTML element with the tagli
to a QF-Test component of the generic classTableCell
if an ancestor has the classTableRow
. - ...=
TAG
-
The preceding expression is only evaluated if the tag of the HTML element matches. Precedes the
@::
operator.
Tags have to be written in capital letters.Can be used with all parameters.
Sample for parameter
genericClasses
:row=TableRow=SPAN
maps an HTML element with the classrow
to a QF-Test component of the generic classTableRow
if the tag isSPAN
.Sample for parameter
genericClasses
:row=TableRow=SPAN@::ancestor=Table
maps an HTML element with the css classrow
to a QF-TestTableRow
only if the tag isSPAN
and if it has a some parent of the classTable
.Sample for parameter
interestingByAttributes
:myid=%.*=CONTAINER
maps HTML elements with the tagcontainer
only if they have the attributemyid
. - @::parent=
class name or TAG
-
Suffix to entries in the parameter lists. The entry will only be evaluated when the direct parent of the GUI element has the given class name or the given tag. Please use capital letters for the tag.
Can be used with all parameters.
Sample for parameter
genericClasses
:css-data-row=TableRow@::parent=Table
maps the HTML element with the css classcss-data-row
to a QF-Test component of the generic classTableRow
only if the direct parent has the classTable
. - @::parent<
level
>=class name or TAG
-
Suffix to entries in the parameter lists. The entry will only be evaluated when the parent of the given level of the GUI element has the given class name or the given tag. Please use capital letters for the tag.
The level relies on the component structure recorded by QF-Test or the generated DomNode, so they could fail if the web-page or your resovler get changed. You should consider using the normal
@::ancestor
operator in that case or mapping a dedicated parent to a specific parent class which you can then use with@::parent
or@::ancestor
. The sample in CustomWebResolver – Tables shows this technique.Can be used with all parameters.
Sample for parameter
genericClasses
:css-button=Button:ComboBoxButton@::parent<3>=ComboBox
maps the button as of typeComboBoxButton
if the parent at level three has the classComboBox
. - @::ancestor<
level
>=class name or TAG
-
Suffix to entries in the parameter lists. The entry will only be evaluated when a parent of the GUI element up to the given level has the given class name or the given tag. Please use capital letters for the tag.
Can be used with all parameters.
Sample for parameter
genericClasses
:cbx=CheckBox:ListItemCheckBox@::ancestor<3>=List
maps the check box as of typeListItemCheckBox
if an ancestor within three parent levels has the classList
. (Count of levels as with @::parent.) -
attribute
=value
-
Can be used with the parameters
ignoreByAttributes
andinterestingByAttributes
.With the parameter
ignoreByAttributes
the entry has the effect that no nodes will be created in the component hierarchy for HTML elements with the given attribute value.With the parameter
interestingByAttributes
the entry has the effect that a component will be recorded for HTML elements where the attribute has the given value.Sample for parameter
ignoreByAttributes
:type=container
ignores all nodes where the attributetype
has the valuecontainer
when creating the parent hierarchy of a node.Sample for parameter
interestingByAttributes
:type=splitpane
creates a node in the parent hierarchy if the attributetype
has the valuesplitpane
.
In case you are interested:
@::ancestor=class
internally uses the object method obj.getAncestorOfClass(class
).
@::ancestor<level
>=class
internally uses the
object method obj.getAncestorOfClass(class
, level)
@::parent= internally uses the object method obj.getParent()
@::parent<level
>= internally uses the object method
obj.getNthParent(level
)
For details of the methods please refer to Pseudo DOM API.