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 22. 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 22. 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:

Test attributes
Figure 41.95:  'Test' 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:

CharacterReplacement
%Literal '%' character.
+Literal '+' character.
iThe current runid as specified with -runid <ID>.
rThe error level of the partial log.
wThe number of warnings in the partial log.
eThe number of errors in the partial log.
xThe number of exceptions in the partial log.
tThe thread index to which the partial log belongs (for tests run with parallel threads).
yThe current year (2 digits).
YThe current year (4 digits).
MThe current month (2 digits).
dThe current day (2 digits).
hThe current hour (2 digits).
mThe current minute (2 digits).
sThe current second (2 digits).
Table 41.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 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

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.

WebResolver_setup_sequence
Figure 41.96:  CustomWebResolver call in 'Setup' node of the Quickstart Wizard

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
Configure component recognition for web applications.
Parameters
resolver The short name of the resolver to extend. Either
- autodetect (default) to determine the framework automatically or
- custom if you do not use any of the frameworks supported by QF-Test or
- the framework name, e.g. zk or vaadin. For the correct name please refer to the table table 50.7.
If you created the start sequence via the quick start wizzard and entered a framework there, it will be shown in the parameter.
version The resolver version, e.g. 1 or 1.0 or 1.1.1. The latest available version with the given restriction will be used. So, if 1.0 is given then the latest 1.0.x will apply. If empty, the latest available version will be used.
Delete or leave empty when auto detection is used.
genericClasses (Optional) A list of assignments mapping a css class to a generic QF-Test class.
The parameter evaluates the class attribute of the GUI element only. The class attribute can hold several css classes, separated by spaces. For the mapping of a GUI element you can specify one of the css classes.
Can be overridden by attributesToGenericClasses.
e.g. css-button=Button,ui-table=Table.
Sample for a GUI element with sereral css classes:
class="button css-button active". Above example makes use of the css class css-button.
(uses node.getAttribute(class)).
attributesToGenericClasses (Optional) A list of assignments mapping GUI elements with the given attribute value to QF-Test components of the given generic class.
The mapping refers to the whole value of the attribute.
Assignments from here can override mappings done in the genericClasses parameter.
e.g. id=table=Table,name=%.*combo.*=ComboBox.
Sample for overriding the parameter genericClasses with several css classes:
class=button css-button active=Button.
tagsToGenericClasses (Optional) A list of assignments mapping a tag to a generic QF-Test class.
Tags have to be written in capital letters,
e.g. LI=ListItem.
ignoreTags (Optional) A list of class names or tags for which to ignore nodes when creating the parent hierarchy of a node. Tags have to be written in capital letters,
e.g. DIV,TBODY. In this example all DIV and TBODY nodes not mapped to some other class will be ignored.
ignoreByAttributes (Optional) A list of attributes values for which to ignore nodes when creating the parent hierarchy of a node.
e.g. id=container,id=header.
autoIdPatterns (Optional) A list of patterns specifying ids generated automatically by the framework. If the id attribute matches the pattern the node will be ignored,
e.g. myAutoId,%auto.*.
customIdAttributes (Optional) A list of attribute names which can act as id for the component,
e.g. myid,qft-id will use the attributes myid and qft-id for id resolution.
interestingByAttributes (Optional) A list of attribute values telling QF-Test to create a node in the component tree for the respective GUI object,
e.g. id=container,id=header.
attributesToQftFeature (Optional) A list of attributes where the values will to be used for the 'Feature' attribute of the QF-Test component.
documentJS (Optional) Javascript code to be injected into the web page. Can be used to inject custom Javascript functions.
attributesToQftName (Optional) A list of attributes which will be used for QF-Test name recognition of components.
Use with care. If not sure contact the QF-Test support team.
nonTrivialClasses (Optional) A list of CSS classes of objects which shouldn't be ignored by QF-Test. Trivial nodes are I, FONT, BOLD etc. If you want to keep them, you need to activate them here specifying a proper CSS class.
Use with care. If not sure contact the QF-Test support team.
allBrowsersSemihardClasses (Optional) A list of classes to activate semi-hard events for, e.g. Button, for all browsers.
Use with care. If not sure contact the QF-Test support team.
An Alternative might be setting the global Options.OPT_WEB_SEMI_HARD_EVENTS option to true, which works for all components.
chromeSemihardClasses (Optional) A list of classes to activate semi-hard events for, e.g. Button, for Chrome.
Use with care. If not sure contact the QF-Test support team.
An Alternative might be setting the global Options.OPT_WEB_SEMI_HARD_EVENTS option to true, which works for all components.
ieSemihardClasses (Optional) A list of classes to activate semi-hard events for, e.g. Button, for IE.
Use with care. If not sure contact the QF-Test support team.
An Alternative might be setting the global Options.OPT_WEB_SEMI_HARD_EVENTS option to true, which works for all components.
mozSemihardClasses (Optional) A list of classes to activate semi-hard events for, e.g. Button, for Firefox.
Use with care. If not sure contact the QF-Test support team.
An Alternative might be setting the global Options.OPT_WEB_SEMI_HARD_EVENTS option to true, which works for all components.
edgeSemihardClasses (Optional) A list of classes to activate semi-hard events for, e.g. Button, for Edge.
Use with care. If not sure contact the QF-Test support team.
An Alternative might be setting the global Options.OPT_WEB_SEMI_HARD_EVENTS option to true, which works for all components.
allBrowsersHardClasses (Optional) A list of classes to activate hard events for, e.g. Button, for all browsers.
Use with care. If not sure contact the QF-Test support team.
An alternative might be activating "Replay as hard event" for mouse-click nodes.
chromeHardClasses (Optional) A list of classes to activate hard events for, e.g. Button, for Chrome.
Use with care. If not sure contact the QF-Test support team.
An alternative might be activating "Replay as hard event" for mouse-click nodes.
ieHardClasses (Optional) A list of classes to activate hard events for, e.g. Button, for IE.
Use with care. If not sure contact the QF-Test support team.
An alternative might be activating "Replay as hard event" for mouse-click nodes.
mozHardClasses (Optional) A list of classes to activate hard events for, e.g. Button, for Firefox.
Use with care. If not sure contact the QF-Test support team.
An alternative might be activating "Replay as hard event" for mouse-click nodes.
edgeHardClasses (Optional) A list of classes to activate hard events for, e.g. Button, for Edge.
Use with care. If not sure contact the QF-Test support team.
An alternative might be activating "Replay as hard event" for mouse-click nodes.
 
 

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 with list

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 class css-button to a QF-Test component of the generic class Button.

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 class Table if the attribute role has the value datatable.

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 tag li to a QF-Test component with the generic class ListItem.

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 tag li to a QF-Test component of the generic class TableCell if an ancestor has the class TableRow.

...=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 class row to a QF-Test component of the generic class TableRow if the tag is SPAN.

Sample for parameter genericClasses:

row=TableRow=SPAN@::ancestor=Table maps an HTML element with the css class row to a QF-Test TableRow only if the tag is SPAN and if it has a some parent of the class Table.

Sample for parameter interestingByAttributes:

myid=%.*=CONTAINER maps HTML elements with the tag container only if they have the attribute myid.

@::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 class css-data-row to a QF-Test component of the generic class TableRow only if the direct parent has the class Table.

@::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 type ComboBoxButton if the parent at level three has the class ComboBox.

@::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 type ListItemCheckBox if an ancestor within three parent levels has the class List. (Count of levels as with @::parent.)

attribute=value

Can be used with the parameters ignoreByAttributes and interestingByAttributes.

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 attribute type has the value container when creating the parent hierarchy of a node.

Sample for parameter interestingByAttributes:

type=splitpane creates a node in the parent hierarchy if the attribute type has the value splitpane.

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.