16. décembre 2022
SmartID – The next generation of component recognition
Many QF-Test users are familiar with the problem: As your tests grow, so does the component tree under "Windows and components". It eventually grows so huge that you are forced to give up on keeping on top of individual components.
For less complex test scenarios, this is not a problem. QF-Test is designed in a way that ideally you don't have to pay attention to the component tree at all; thanks to intelligent "record & replay", QF-Test takes care of creating and reusing components automatically.
However, more than a few of our customers broke through that limit where maintenance of the component tree could not be left to QF-Test alone. Together with them we worked on different solutions. A frequently used pattern were generic components. QF-Test version 6.0 then introduced the superior SmartID feature.
A detour through generic components
A generic component is a component where the deciding properties are filled with a variable, so the component can be resolved to different GUI elements depending on the current variable value. In the right hands, generic components are a powerful tool to keep the component tree clear and concise, thus increasing overall readability of a test suite.
But generic components repeatedly reached their limits as well. The use of the QF-Test recording function for test development was severely limited. To completely rely on generic components, individual components for every single class and generic property and all combinations of both had to be created and maintained. This quickly became tedious. It got especially unmanageable when changes in the application under test required modifications to component recognition. Then, variable values and procedure parameters had to be adjusted across all test suites until the generic components were again correctly resolved.
So, we continued working on this problem, and finally arrived at a completely new paradigm: SmartID.
SmartID – Component recognition "smart"
Different from generic components, SmartID is not just a usage pattern, but a completely new feature for addressing GUI elements. During development of SmartID, our guiding principle was to keep simple things simple.
One of the strenghts of the classic component tree is QF-Test mostly taking care of maintaining the concrete components (thanks to the recording feature). The decicisive advantage of generic components is avoiding the complexity of the component tree by focusing only on relevant element properties.
SmartID in turn combines these two advantages: Taking care of the component tree is no longer neccessary, and the deciding recognition criteria can still be precisely targeted.
But how does it work? The component definition is moved entirely into the "QF-Test component ID" reference:
In a SmartID, one or a combination of recognition criteria is explicitly selected through a powerful syntax. The SmartID is declared directly in place of the QF-Test ID of the component. So, no component step needs to be referenced or generated at all. And: QF-Test is intelligent enough to even create SmartIDs instead of component steps during recording of clicks and checks, if desired.
All the while, SmartID has access to all the same recognition criteria as recorded components.
Areas of SmartID application
Thanks to SmartID it is now possible to comfortably do test-driven development (TDD) or keyword-driven testing (KDT) with QF-Test. SmartIDs do not have to be recorded, but can be derived from the specification of an even not yet developed application.
This independence from the concrete state of the SUT also enables easier integration with other test tools like Robot Framework, or technology-agnostic tests, for example of a Web and an Android client of the same application.
Available since QF-Test 6.0
Since QF-Test version 6.0, SmartID is fully available as a preview feature. Automatic recording can be activated through the "Recording" menu.
But what does "preview" mean? We want to allow ourselves to add fixes and small changes in the details of SmartID, because we have not jet implemented our full vision for the feature. However, we encourage our customers to use SmartID without fear of backwards compatibility issues. More than a few companies (ourselves included) already have SmartID in productive use.
Is this the end of the component tree?
We are conviced that SmartID will be the best way to target GUI components in QF-Test going forward. We want to especially discourage the ongoing use of generic components, since SmartID outperforms them in almost all areas of application.
Still, the component tree in QF-Test will not be deprecated in the forseeable future. There will always be situations where a classic recorded component will be easier to manage or faster than a SmartID. SmartID and classic components can be seamlessly combined, so there is no need to for rivalry.