45.1.1
General configuration

The procedure installCustomWebResolver of the standard library qfs.qft offers the following functionality:

Mapping of HTML objects to functional components
You can map functional GUI objects as buttons, text fiels, data tables etc to QF-Test components of a certain generic class. Advantages:
- recording of additional criteria for recognition,
- class specific checks,
- indexing of sub items at recording,
- recording of generic class types,
- better component recognition just via specific generic QF-Test classes vs common HTML classes.

The data recorded for a certain object depends on its generic class as described in Generic classes.
Reduction of the recorded component hierarchy
You can tell the recording algorith to ignore certain HTML components in the component's hierarchy. This reduces the complexity of a recorded web-page from the full HTML structure to a component hierarchy relevant for recognition or structuring.
Video The video 'Dealing with the explosion of complexity in web test automation' gives you a good idea of how QF-Test handles a deeply nested DOM structure.
Current recording Simplified recording
Current recording Simplified recording
Figure 45.1:  Reduction of complexity for WebCarConfigurator demo
Using alternative attributes for ids
By default QF-Test uses the HTML attributes id or name to identify a component and saves them in the 'Name' attribute of the 'Component' node. You can configure installCustomWebResolver to use a different HTML attribute as id.
Specification of further attributes for recognition
You can specify an attribute useful for component recognition, the value of which QF-Test will save to the 'Feature' attribute of the component.

You can use the following HTML features to identiy a GUI object:

  • the class attribute,
  • any other attribute,
  • the HTML tag.

The mapping of the HTML attributes can be subject to certain conditions. QF-Test offers the following options to set conditions for single mappings. It is possible to combine them.

  • The use of regular expressions.
  • Map only if the object is a child component (at a given depth) of another object of a given class.
  • Map only if the object has a certain HTML tag, additonally to the other criteria.

A functional component often may consist of nested layers of elements. Some of the layers may have attributes useful for component recognition, others not. For recording and replay it does not matter which layer you map. The main thing is to has attributes for component recognition. QF-Test will also check nested components for further attributes and save them with the mapped QF-Test component. Example: Mapping of TabPanels and Accordions

In addition you get functional components such as combo boxes, lists, tables and trees which have to be implemented in HTML via several objects, named 'complex components' in QF-Test, i.e. a list, where you need to tell QF-Test which HTML object will be the list container and which HTML objects will be the list items.

The following sections provide a list of mandatory and optional GUI elements which need to be mapped for a complex component to be recognized as such, each containing a comprehensive example.

In most cases the HTML attribute class is significant for component recognition and provides information about the functional type of the component, sometimes it is other attributes. And some frameworks use JavaScript methods a lot. For adapting QF-Test to those frameworks you need to implement other resolvers additionally to installCustomWebResolver. In this chapter, the focus is on the first two. For adapting QF-Test to frameworks based on JavaScript methods please get in touch with our support.