Why Use the Model Manager
In desktop application automation testing, accurately identifying and interacting with controls is one of the key factors for successful testing.
Precise control recognition and operation directly affect test stability and overall efficiency. However, as applications evolve and iterate, keeping test scripts synchronized with UI changes becomes increasingly challenging.
How to efficiently maintain test scripts when the UI changes has therefore become a major concern for developers and test engineers.
Traditionally, control locators are hardcoded directly into test scripts. While this approach may work in the short term, every UI update can cause changes in control properties, leading to script failures.
To fix these issues, testers often need to manually update large sections of code — a time-consuming process that can easily introduce new errors and increases the complexity and maintenance cost of automated tests.
To address these challenges, CukeTest introduces Model Files (.tmodel) and the Model Manager, providing a centralized way to manage control information and significantly improve test maintenance efficiency.
The Role of Model Files and the Model Manager
The .tmodel file serves as the central repository for control object information in CukeTest, recording all objects involved during testing.
The Model Manager helps you efficiently maintain and update this information. When the application UI changes, you only need to update a few control entries rather than modify scripts extensively.
This approach not only reduces script maintenance workload but also enhances flexibility and stability in the testing process.
Beyond control information management, the Model Manager also supports Control Operation Debugging and Code Generation, allowing automatic generation of control-invocation scripts.
These features greatly simplify script creation — even beginners can quickly produce efficient and reliable automated tests.
How to Open the Model Manager
You can open the Model Manager in two ways:
- In the top-right corner of the CukeTest main interface, click the Model Manager icon
.
- In your project folder, double-click the model file
*.tmodelicon.
How Model Files Work
During test recording, CukeTest automatically saves all control objects involved in interactions into a model file (.tmodel).
Each control object is stored with a unique identifying property used for recognition in future test runs.
You can also manually add control objects using the Model Manager’s Spy Feature.
When a new control is added, CukeTest automatically compares it against existing objects in the model to prevent duplicate entries.
During test execution, CukeTest locates controls based on the identifying properties stored in the model file.
If a control’s attributes change or multiple controls share the same identifier, CukeTest may fail to recognize the correct object, resulting in a test failure.
In such cases, you need to update the object’s identifying properties to restore uniqueness and reliability.
Why Manage Controls in a Tree Structure?
Most desktop application interfaces can be represented as a control tree, similar to the DOM structure of a web page.
CukeTest adopts this hierarchical model to manage application UI controls, making control management more intuitive and efficient.
| DOM in Web Pages | Tree Structure in the Model Manager |
|---|---|
Root node is the <html> tag |
Root node is typically the application window control window |
Elements located using id or class selectors |
Controls located using identifying properties |
| Retrieve element attributes | Retrieve control attributes or perform control operations |
Using a tree structure not only provides a clear visualization of control hierarchy but also enables more precise recognition and interaction with each control — greatly improving the efficiency and reliability of automated testing.