Handbuch

45.3
Special support for various AJAX toolkits

The acronym AJAX for "Asynchronous JavaScript and XML" is generally associated with modern web applications that provide a more interactive look and feel than classical <FORM> based applications, almost comparable to desktop applications. Behind this common acronym there is a whole zoo of toolkits that drive those applications, each with different key aspects and unique widget sets. Such toolkits pose a problem for QF-Test and in fact any automated testing tool for several reasons:

  • The actual component hierarchy is created automatically from abstract widgets like Buttons or Lists. Often each widget is implemented as a number of <DIV> nodes. This leads to very deeply nested hierarchies with very little structure.
  • IDs are either not assigned at all or automatically created and thus worse than useless.
  • The asynchronous communication with the web server and dynamic creation of DOM nodes may cause timing-related problems.

There is no panacea to address these problems in a generic way. In most cases QF-Test can interact with AJAX applications out-of-the-box, but component recognition and performance are not ideal. Optimal testability can only be achieved with special case handling that exactly fits a given toolkit and takes advantage of its peculiarities.

For the following list of toolkits QF-Test provides resolvers for optimized handling:

Toolkit name Toolkit homepage
Angular http://angular.io
Ext GWT http://www.extjs.com
Ext JS http://www.extjs.com
Google Web Toolkit (GWT) http://www.gwtproject.org
ICEfaces http://icesoft.org
jQuery UI http://jqueryui.com
jQuery EasyUI http://jeasyui.com
Kendo UI http://telerik.com/kendo-ui
Prime Faces http://primefaces.org
Qooxdoo http://www.qooxdoo.org
Rich Ajax Platform (RAP) http://www.eclipse.org/rap
RichFaces http://www.jboss.org/richfaces
Smart GWT http://www.smartclient.com
Vaadin http://vaadin.com
ZK http://zkoss.org
Table 45.1:  Supported AJAX toolkits

QF-Test is even able to automatically detect whether one of those toolkits is used in your web application and to install the respective resolver as described below.

45.3.1
AJAX resolver concepts

An AJAX resolver is a set of resolvers and other methods implemented specifically for a given AJAX toolkit. Most notably QF-Test tries to assign individual classes matching the high-level widgets to DOM nodes and remove intermediate nodes that are just an implementation detail. 'Name', 'Feature' and 'Extra feature' attributes are determined in a way suitable for the toolkit and events are simulated on the correct DOM node in a way that most closely matches user interaction. These measures drastically reduce the component hierarchy and increase the reliability and performance of component recognition and replay. Timing and synchronization are also addressed.

As a necessary consequence the components and events recorded for a given web application vary drastically with and without an active AJAX resolver and are not compatible with each other. Thus the decision whether or not to use an AJAX resolver should be made as early as possible, otherwise tests will either need to be reimplemented after activating the resolver or tests with and without resolver must be cleanly separated. If a resolver is available for your application you should practically always use it. The only exception is if the existing test-base is already too large, mostly complete and stable.

Implementing AJAX resolvers is an ongoing process. As changes to a resolver can have consequences in terms of how components are recorded and recognized we need to make sure that you can update your QF-Test version without losing backwards compatibility with existing tests. To that end, AJAX resolvers have their own three-digit versioning scheme, starting with version 1.0.0, with the following meaning:

  • A change in the minor version, e.g. 1.0.1, means that compatibility is not affected.
  • Medium version changes, e.g. 1.1.0, imply that tests recorded with a lower medium version should still replay, but recording additional sequences may record components in a different way. This is not critical, but you may want to avoid it in case the benefits of the newer version don't outweigh it.
  • A major version change, e.g. 2.0.0, can be incompatible even for replay so that manual updates or new recording of the affected components may be required.

AJAX resolvers are activated via the procedure qfs.web.ajax.installCustomWebResolver in the standard library qfs.qft where you have to provide the version to use. You can choose to specify only the major version, in which case QF-Test uses the latest medium.minor version available for this major version. This is normally the best option and used in the SUT startup sequences created with QF-Test's Quickstart Wizard (see chapter 3). Alternatively you can specify major.medium version or even major.medium.minor to use an exact version and thus run your tests with the resolver version with which they were created.

45.3.2
Supported AJAX toolkits

Unfortunately the number of available AJAX toolkits keeps growing rapidly and popularity changes frequently so we have to weigh carefully which toolkit to support and to which degree. Cooperation with QF-Test users also plays a major role. Resolver development may also be frozen - except for critical bug fixes - if a toolkit loses relevance.

This section lists the supported AJAX toolkits and versions with the available resolver versions. Newer toolkit versions don't necessarily require an update of the resolver. If your application uses a newer version of the toolkit than the supported versions listed below, please use the latest AJAX resolver available for this toolkit and let us know about your results.

4.1+ In QF-Test version 4.1 we have re-worked the integration of most toolkits and adapted it to the concept of generic classes. Therefore, you should install those resolvers with the procedure qfs.web.ajax.installCustomWebResolver. In case you need to work with older versions of those resolvers you can still use them. You can find a list of such older resolvers at subsection 45.3.4.

45.3.2.1
Angular

The resolver was developed against Angular version 4.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is angular.

Resolver version QF-Test version Remarks
1.0.0 4.2.2 Support for Angular Version 5
1.0.0 4.2.0 Initial version with support for generic classes and sub-items based on the online demo components (Angular Material, Bootstrap)
Table 45.2:  Angular resolver versions
45.3.2.2
Ext JS

The resolver was initially created for Ext JS version 2 but does support Ext JS version 6 in the meantime.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is extjs.

Resolver version QF-Test version Remarks
3.1.1 4.0.7 Support for Ext JS version 6
3.1.0 4.0.3 Further generic classes
3.0.0 4.0.2 Support for Ext JS version 5
older 3.0.0 3.5M1 See subsection 45.3.4.1.
Table 45.3:  Ext JS resolver versions
45.3.2.3
Ext GWT

There is no separate Ext GWT resolver. Ext GWT is in fact a combination of Ext JS and GWT and QF-Test supports it by installing both the Ext JS and the GWT resolver. There are no development activities at the moment. You can use older versions, please see subsection 45.3.4.2.

45.3.2.4
Google Widget Toolkit - GWT

The Google Widget Toolkit has been supported starting with GWT version 1.5.

Its shortname for calling qfs.web.ajax.installCustomWebResolver or qfs.web.ajax.installToolkitResolver is gwt.

Resolver version QF-Test version Remarks
2.0.0 4.0.3 New implementation written from scratch with support for a wider range of GWT components based on GWT version 2.7.
older 2.0.0 3.4.2 See subsection 45.3.4.3.
Table 45.4:  GWT resolver versions
45.3.2.5
ICEfaces

The resolver was developed against ICEfaces version 3.3.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is icefaces.

Resolver version QF-Test version Remarks
2.0.1 4.0.10 Support for ICEfaces version 4.1
older 2.0.0 3.5.3 See subsection 45.3.4.4.
Table 45.5:  ICEfaces resolver versions
45.3.2.6
jQuery UI

The resolver was developed against jQuery UI version 1.10.3.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is jqueryui.

Resolver version QF-Test version Remarks
1.1.0 4.0.0 Initial version with support for generic classes and sub-items based on the online demo widgets
older 1.1.0 4.0.0 See subsection 45.3.4.5.
Table 45.6:  jQuery UI resolver versions
45.3.2.7
jQuery EasyUI

The resolver was developed against jQuery EasyUI version 1.4.1.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is jeasyui.

Resolver version QF-Test version Remarks
1.0.0 4.0.4 Initial version with support for generic classes and sub-items based on the online demo widgets
Table 45.7:  jQuery EasyUI resolver versions
45.3.2.8
Kendo UI

The resolver was developed for version Q1 2016.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is kendoui.

Resolver version QF-Test version Remarks
1.0.0 4.1.0 Initial version with support for generic classes and sub-items
Table 45.8:  Kendo UI resolver versions
45.3.2.9
PrimeFaces

The resolver was developed against PrimeFaces version 3.5 but does support PrimeFaces version 5 in the meantime.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is primefaces.

Resolver version QF-Test version Remarks
2.1.0 4.1.1 CSS-classes beginning with ui- are not automatically accepted as good classes for class resolving. Previous recordings can still be replayed.
2.0.2 4.0.10 Support for PrimeFaces version 5.3
2.0.0 4.0.2 Support for PrimeFaces version 5
older 2.0.0 3.5.1 See subsection 45.3.4.6.
Table 45.9:  PrimeFaces resolver versions
45.3.2.10
Qooxdoo

The resolver was developed against qooxdoo version 5.0.2.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is qooxdoo.

Resolver version QF-Test version Remarks
2.0.0 4.1.4 Updated to Qooxdoo version 5.0.2 and usage of generic classes.
older 2.0.0 3.1.1 See subsection 45.3.4.7.
Table 45.10:  Qooxdoo resolver versions
45.3.2.11
Remote Application Platform - RAP

The resolver was developed against RAP version 1. Support for RAP version 2 and higher is complete.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is rap.

Resolver version QF-Test version Remarks
3.0.3 4.0.6 Updated for RAP version 3.0; retrieval of names set via widget.setData("name", ...)
3.0.2 - Experimental internal version
3.0.1 - Experimental internal version
3.0.0 3.5.1 Updated for RAP version 2.0 (Remote Application Platform)
older 3.0.0 3.5M1 See subsection 45.3.4.8.
Table 45.11:  RAP resolver versions
45.3.2.12
RichFaces

The resolver was developed against RichFaces versions 3, 4 and 5.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is richfaces.

Resolver version QF-Test version Remarks
3.0.1 4.0.4 Improved handling of enabled state of elements.
3.0.0 4.0.0 Make use of generic classes and updated to work with experimental version of RichFaces 5
older 3.0.0 3.5.2 See subsection 45.3.4.9.
Table 45.12:  RichFaces resolver versions
45.3.2.13
Smart GWT

The resolver was developed against Smart GWT version 6.1.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is smartgwt.

Resolver version QF-Test version Remarks
1.0.0 4.2.0 Initial version with support for generic classes and sub-items based on the online demo components
Table 45.13:  Smart GWT resolver versions
45.3.2.14
Vaadin

Vaadin is another toolkit that is based on GWT but comes with additional features and its own widget set.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is vaadin.

Resolver version QF-Test version Remarks
2.0.0 4.1.0 Refactored in order to use CustomWebResolver concepts
older 2.0.0 3.5M1 See subsection 45.3.4.10.
Table 45.14:  Vaadin resolver versions
45.3.2.15
ZK

The resolver was developed for versions 6.5 and 7.

Its shortname for calling qfs.web.ajax.installCustomWebResolver is zk.

Resolver version QF-Test version Remarks
1.2.0 4.0.5 Fixed some rare issues when reading text from table cells or tree nodes containing multiple components.
1.1.1 4.0.3 Improvements in determining text of MenuItems.
1.1.0 3.5.90 Support for common generic classes and use of IDs from zul files as component names.
1.0.1 3.5.2 Minor improvements on component recognition and better filtering of auto generated ZK IDs.
1.0.0 3.5.1 Initial version with support for generic classes, sub-items and checks.
Table 45.15:  ZK resolver versions
45.3.3
Setting unique IDs

Any AJAX toolkit has its custom way of setting unique IDs. Please find details about the supported ones in the following chapter:

45.3.3.1
Angular

The simplest solution is to set the 'ID' attribute <div id="myId"/> for any required component.

45.3.3.2
Ext JS

You can set IDs like
var container = Ext.create('Ext.container.Container', {
id: 'MyContainerId',
... });
.

As alternative you can also call container.getEl().set({ 'qfs-id': 'myId' });. In this case you will need to implement a NameResolver for reading 'qfs-id' as name for QF-Test.

45.3.3.3
GWT

The simplest way is calling the method widget.getElement().setId("myId"); for the required widgets.

As an alternative you can also call widget.ensureDebugId("myId"). But if you want to use that method you need to modify your xxx.gwt.xml file to enable debug IDs. Add <inherits name="com.google.gwt.user.Debug"/> to the file.

It's also possible to set a custom identifier which can then be used via a NameResolver.For example call setAttribute("qfs-id", "myId") to set an 'qfs-id' attribute.

45.3.3.4
ICEfaces

The simplest solution is to set the 'ID' attribute <p:inputText id="myId"/> for any required component in the xhtml definition.

45.3.3.5
jQuery UI

The simplest solution is to set the 'ID' attribute <p:inputText id="myId"/> for any required component. Additionally, you can give an existing element an id with: $(element).attr("id","myId");

45.3.3.6
jQuery EasyUI

The simplest solution is to set the 'ID' attribute <p:inputText id="myId"/> for any required component.

45.3.3.7
Kendo UI

You need to set the 'ID' attribute in your source code or graphical editor.

45.3.3.8
PrimeFaces

The simplest solution is to set the 'ID' attribute <p:inputText id="myId"/> for any required component in the xhtml definition.

45.3.3.9
Qooxdoo

There is no default mechanism. You can either apply a custom attribute to the generated DOM nodes or add a custom attribute to the setData method of the widget. You can evaluate those attributes in a resolver.

45.3.3.10
RAP

Starting with RAP version 2.2 a name set via widget.setData("name", "myId") is retrieved automatically by QF-Test, just as for SWT. This field can only be used if it is registered with WidgetUtil.registerDataKeys("name"); before.

For RAP versions older than 3.0.0 the following technique is also available. It is discouraged because it deviates from the SWT standard and requires additional settings for the webserver:

Call the method widget.setData(WidgetUtil.CUSTOM_WIDGET_ID, "myId"); for the required widgets.

After applying IDs to components you need to modify your webserver environment and specify the following parameter -Dorg.eclipse.rap.rwt.enableUITests=true before launching the webserver.

Note: The VM argument was renamed in RAP 2.0. For RAP versions older than 2.0 its name is -Dorg.eclipse.rap.rwt.enableUITests=true.

45.3.3.11
RichFaces

You need to set the 'ID' attribute in your source code or graphical editor.

45.3.3.12
Smart GWT

The simplest solution is to call widget.setID("id") for any required component.

45.3.3.13
Vaadin

The simplest solution is to call widget.setId("id") (widget.setDebugId("id") for Vaadin version < 7) for any required component.

You can also set a custom stylesheet class, which you could read with a NameResolver. Therefore call widget.setStyleName("qfs-id=myId").

45.3.3.14
ZK

QF-Test uses the widget ID, which is also used in the zul files, so you should get meaningful IDs for most of the objects.

The ZK framework also offers a custom IDGenerator to set such IDs. But implementing this could be quite exhaustive. In this case it might be a better choice to rely on the default mechanism of QF-Test.

45.3.4
Using older versions of AJAX resolvers

In QF-Test version 4.1 we have re-worked the integration of most toolkits and adapted it to the concept of generic classes. In your already existing projects you can still use older versions of the provided AJAX resolvers. You can install those older resolvers via the procedure qfs.web.ajax.installToolkitResolver from the standard library qfs.qft.

45.3.4.1
Older Ext JS resolvers

The resolver was initially created for Ext JS version 2.

Its shortname for calling qfs.web.ajax.installToolkitResolver is extjs.

Resolver version QF-Test version Remarks
2.0.0 3.5M1 Support for Ext JS version 4.1, generic classes and sub-items
1.2.0 3.4.1 Support for Ext JS version 4
1.1.0 3.3.0 Improved item support for trees, grids, tab panels and combo lists
1.0.0 3.1.1 Initial version
Table 45.16:  Older Ext JS resolver versions
45.3.4.2
Older Ext GWT resolvers

There is no separate Ext GWT resolver. Ext GWT is in fact a combination of Ext JS and GWT and QF-Test supports it by installing both the Ext JS and the GWT resolver.

Its shortname for calling qfs.web.ajax.installToolkitResolver is extgwt.

45.3.4.3
Older Google Widget Toolkit - GWT resolvers

The Google Widget Toolkit has been supported starting with GWT version 1.5.

Its shortname for calling qfs.web.ajax.installToolkitResolver is gwt.

Resolver version QF-Test version Remarks
1.4.0 3.4.2 Fixed filtering of <DIV> nodes
1.3.0 3.4.1 Added support for GWT-TABLAYOUTPANEL and GWT-TABLAYOUTPANELTAB
1.2.0 3.4.0 Filtering of <DIV> nodes, improved extra features, limited handling for obfuscated GWT class names
1.1.0 3.3.0 Improved support for GWT-TREEITEM, GWT-STACKPANELITEM and GWT-TABBARITEM
1.0.1 3.1.4 Replay improvements for GWT 2.0
1.0.0 3.1.1 Initial version
Table 45.17:  Older GWT resolver versions
45.3.4.4
Older ICEfaces resolvers

The resolver was developed against ICEfaces version 3.3.

Its shortname for calling qfs.web.ajax.installToolkitResolver is icefaces.

Resolver version QF-Test version Remarks
1.0.0 3.5.3 Initial version with support for generic classes and sub-items based on the showcase demo, including support for ACE components
Table 45.18:  Older ICEfaces resolver versions
45.3.4.5
Older jQuery UI resolvers

The resolver was developed against jQuery UI version 1.10.3.

Its shortname for calling qfs.web.ajax.installToolkitResolver is jqueryui.

Resolver version QF-Test version Remarks
1.0.0 4.0.0 Initial version
Table 45.19:  Older jQuery UI resolver versions
45.3.4.6
Older PrimeFaces resolvers

The resolver was developed against PrimeFaces version 3.5.

Its shortname for calling qfs.web.ajax.installToolkitResolver is primefaces.

Resolver version QF-Test version Remarks
1.0.0 3.5.1 Initial version with generic classes and sub-items based on the version 3.5 showcase demo
Table 45.20:  Older PrimeFaces resolver versions
45.3.4.7
Older Qooxdoo resolvers

The resolver was developed against qooxdoo version 0.7.2.

Its shortname for calling qfs.web.ajax.installCustomWebResolver or qfs.web.ajax.installToolkitResolver is qooxdoo.

Resolver version QF-Test version Remarks
1.1.0 3.3.0 Improved support for list and menu items
1.0.0 3.1.1 Initial version
Table 45.21:  Older Qooxdoo resolver versions
45.3.4.8
Older Remote Application Platform - RAP resolvers

The resolver was developed against RAP version 1. Support for RAP version 2 and higher is complete.

Its shortname for calling qfs.web.ajax.installToolkitResolver is rap.

Resolver version QF-Test version Remarks
2.0.0 3.5M1 Support for generic classes and sub-items. RAP Version 1.5 (Rich Ajax Platform)
1.1.0 3.3.0 Improved item support for lists, tab folders, tables and trees
1.0.1 3.3.0 Improved widget recognition
1.0.0 3.1.1 Initial version
Table 45.22:  Older RAP resolver versions
45.3.4.9
Older RichFaces resolvers

The resolver was developed against RichFaces versions 3 and 4.

Its shortname for calling qfs.web.ajax.installToolkitResolver is richfaces.

Resolver version QF-Test version Remarks
2.0.2 3.5.2 Fixes for replaying clicks on Windows 7 systems. Recording and replaying of file:upload elements works correctly now.
2.0.1 3.5M3 Minor fixes
2.0.0 3.5M1 Support for generic classes and sub-items
1.4.0 3.5.0 Supports items for trees, lists, tabs and tables for RichFaces 3 and RichFaces 4.
1.3.0 3.4.8 Replaying menu selections on ddm-itms as hard events. Fixed wrong event filtering for rich-tree components. Several minor fixes for abstract coordinates and replay. Tested with RichFaces v3.3.3 and v4.2.2.
1.2.0 3.4.1 Supports RichFaces 4
1.1.0 3.3.0 Major rewrite
1.0.0 3.1.4 Initial version
Table 45.23:  Older RichFaces resolver versions
45.3.4.10
Older Vaadin resolvers

Vaadin is another toolkit that is based on GWT but comes with additional features and its own widget set.

Its shortname for calling qfs.web.ajax.installToolkitResolver is vaadin.

Resolver version QF-Test version Remarks
1.1.0 3.5.0 Updated for Vaadin 7 based on the dashboard Vaadin demo
1.0.0 3.5M1 Initial version with support for generic classes and sub-items
Table 45.24:  Older Vaadin resolver versions