Generic components

Before the introduction of the SmartID (Preview) in QF-Test Version 6.0, generic components were the pattern of choice for avoiding recording components. With SmartIDs, this goal can be achieved easier and more flexibly. Still, the concept of generic components is described here for backwards compatibility.

A typical use case is the testing of localized applications.

Another situation could be the use of a GUI framework during development. This generates, for example, a lot of similar dialogs which differ by only a few components. But you must re-record them for each dialog, for example global navigation buttons, because they are located inside a new window each time.

With generic components, you use variables in the component properties or simply delete non-dynamic parts of them.

The following is a general approach for generalizing components:

  1. Record some components you want to generalize and compare them.
  2. Create a new generic component with 'generic' in the 'QF-Test ID' so you can find it again later.
  3. Remove all attributes you do not want to use for recognition from this generic component.
  4. Define the recognition criterium, like 'name', 'feature' or 'index'.
  5. Place a variable in this attribute, for example $(name).
  6. To avoid false positives, deactivate geometry recognition by placing a '-' in the 'X' and 'Y' attributes.
  7. Specify '@generic' in the 'Comment' attribute so this component is not inadvertently removed by the 'Remove unused components' action.
  8. Create a procedure for accessing this generic component and use the variable from before as procedure parameter.

Note Generic components are very useful for replay of tests, but QF-Test does not use them for recording. It always records concrete components and you need to manually replace these with generic components afterwards.