QF-TestFree Trial

5.12 Inspecting components

Sometimes it is useful to get extra information about the components saved in the section Windows and components or to view the saved information interacting directly with the application.

It is particularly relevant when mapping components of web applications. This should be done before starting to write tests, as described in Improving component recognition with a CustomWebResolver. The UI inspector can be used to examine the UI elements, currently for Android and web applications.

When working with scripts, it is sometimes helpful to be able to display a list of the methods of a GUI element.

5.12.1 Show methods

Every GUI object has certain (public) methods and fields which can be accessed in a SUT script as soon as it has access to the object (see "Accessing the SUT's GUI components"). To display these, select the »Show methods for component...« from the context menu of a node below the Windows and components branch or right-click the component itself in component recording mode (see "Recording components").

Web The methods and fields that are displayed for HTML elements in a browser cannot be used directly with the object returned by rc.getComponent(). They are JavaScript methods and properties that must be embedded in callJS (see "Pseudo DOM API").

7.0+5.12.2 UI Inspector

The UI inspector shows the component hierarchy of the client and the properties of every component. This can be useful to resolve component recognition problems. Furthermore, it also makes it easier to set up resolvers thanks to the information displayed in the detailed view.

Video In April 2024, a special webinar took place about this topic. Here you can find the special webinar video recording available on our QF-Test YouTube channel.

The UI Inspector is available for Android and Web applications. As of QF-Test version 7.1, Windows and Swing/AWT are also supported and from version 7.1.3, FX is also supported.

The node representation in the component tree will already give an overview of the most important information. If the class name ("Class") is written in blue, the component will be considered as interesting. This in turn will determine whether a Component node will be created for the component. In case a generic class (see "Generic classes") can be determined, the generic class will be represented in bold. Furthermore the original class will be added in brackets. By default, all generic classes will be regarded as interesting. Invisible components will be displayed in grey.

inspector
Figure 5.14:  UI Inspector

Opening the inspector

In order to open the UI inspector you have the following possibilities:

UI Inspector toolbar

The buttons in the toolbar have the following meaning:

Component selection   Select a component to inspect it. During component selection, the record- and check functionality of QF-Test is deactivated. Furthermore actions will not be forwarded to the SUT. That way the information in the UI inspector can be analysed via mouse clicks.
History History   Navigating in the component tree. Together with inspector mode the history function also gets activated, thus remembering selections made in the UI inspector and the client, which makes it possible to jump forward and backwards in the component tree.
Reload   Refresh component tree. Updating is required when components have changed or an resolver has been installed.
Show invisible components   Show invisible components in the component tree. Components with visible childs will always be displayed.
Show geometry   Show geometry information in the component tree.

11.1+Searching and filtering the component tree

Above the component tree there is a search field for finding components in large hierarchies. The field works in two modes which you can switch with the two buttons at its right edge:

Search and filter can be combined: the chips determine which components are shown, the search text marks hits among them. If a component is both a search hit and a filter hit, the yellow search color is shown. The reset button (cross) at the field, which is only shown while the field contains text, clears the search text only. The button next to the chips removes all chips only and is only shown while there are at least two chips. Escape clears the search text and removes all chips. Search text and chips are kept when the component tree is refreshed. The most important shortcuts are listed in "UI Inspector".

The menu »Search Scope« defines which information is searched. It can be set separately for the text search (Text search covers up to) and for the filter (Filter covers up to). The levels build on each other:

By default the text search covers up to the QF details, the filter only the general information. The higher levels need more information from the client: If the component tree was loaded without that information, it is reloaded once when a search or filter needs it. The technical details of all components are then collected together with the component tree, the QF details are collected with extended information. For very large component trees this reload may therefore take longer. If this is a problem, select a lower level.

UI Inspector details

The UI inspector view gives an overview of the most important properties of a component. The view is divided into three sections:

11.1+While a search or filter is active, the terms are highlighted in the details view: search text in yellow, filter chips in light blue. Only values of those sections are highlighted that are covered by the selected »Search Scope«, labels and the SmartID are never highlighted.