Below are typical causes of the problem and typical ways to eliminate them.
Most possible causes
The object didn’t exist at the time TestComplete tried to obtain it.
The object didn’t exist at the time TestComplete tried to obtain it.The object didn’t exist at the time TestComplete tried to obtain it.It’s quite possible that the needed window or control, or some of its parent objects didn’t exist in the system at the needed time. This can happen in the following cases:
-
Your test failed to simulate some actions that open the needed window. Check earlier error messages in the log to find the root cause of the problem.
-
The developers changed the application logic, and your test doesn’t have commands to invoke the needed window or control. In this case, you need to modify your tests.
-
It takes some time for the tested application to display a window or control on screen. The test engine waits for the objects to appear, but the default waiting timeout may be insufficient. In this case, modify your test so that it waits for the needed object longer. The way you do this depends on the type of your test. For detailed information, see Waiting for Process or Window Activation.
The object’s recognition criteria changed. (Applicable to desktop and web tests)
The object’s recognition criteria changed. (Applicable to desktop and web tests)The object’s recognition criteria changed. (Applicable to desktop and web tests)In desktop tests and in web tests that implement the classic approach, to recognize windows and controls, TestComplete uses properties that identify the object among its siblings. In cross-platform web tests, it recognizes elements on a web page by XPath expressions and CSS selectors.
TestComplete stores those recognition criteria in the Name Mapping repository along with custom names assigned to the tested objects.
One of the most possible causes of the error is that the application has been modified and the actual criteria values no longer match the criteria that the Name Mapping repository stores.
During the test run, if TestComplete cannot find a tested object using the expected properties, it will try to find an object similar to the missing one:
If the object is found
If the Enable Self-Healing mode option is enabled, TestComplete will use the found replacement object during the test. After the test run is over, TestComplete will suggest updating the expected properties to match the replacement object:
Desktop
Click the image to enlarge it.
Web (Cross-Platform)
Click the image to enlarge it.
Web (Classic)
Click the image to enlarge it.
If the option is disabled or if the self-healing mode is not applicable, the error message will show the Intelligent Fix button:
Desktop
Click the image to enlarge it.
Web (Cross-Platform)
Click the image to enlarge it.
Web (Classic)
Click the image to enlarge it.
Click the button to open the Update Recognition Attributes dialog and follow its instructions to update the identification properties.
If the object is not found
In desktop and classic web tests
Click the View and change link in the Details panel of the error message:
Click the image to enlarge it.
TestComplete will open the Name Mapping repository and select the problematic object in it. You can update its identification properties automatically with the Update Name Mapping wizard (see Update Name Mapping Wizard) or you can modify the property list and property values manually (see Name Mapping - Basic Mapping Criteria).
In cross-platform web tests
-
Click the Update the search criteria link in the Details panel
-
TestComplete will open the Update Selectors from Object dialog.
-
Using the or tools that the dialog provides, point to the target object in the web browser.
-
Click OK. TestComplete will generate selectors for the object you have pointed to and replace the stored selectors with the new ones.
Click the image to enlarge it.
Tips:
-
If the identification criteria include the Index
property and the value of this property has changed, exclude this property from the criteria. It does not provide the unique identification of the tested object in your case. Explore other properties of the missed object and try to find properties that identify the object uniquely.
Besides using the object’s properties for identification, you can also use properties of its child objects. For instance, you can map a form by the text of one of its buttons or text boxes.
-
The identification criteria can include the caption (or text) of the tested window or control. You can use wildcards (*
and ?
) or regular expressions to specify variable parts of the caption. ?
stands for any single character, *
stands for an arbitrary string. For instance, if the window caption looks like MyFile - Notepad, you can replace the file name with *
and use the following identification criteria: * - Notepad. To specify more complicated parts of a caption, use regular expressions.
You can use these wildcards to specify the value of any properties of string type like WndClass
or wText
.
-
Do not use the Name
and FullName
properties for object identification.
-
To map objects of Open Applications, TestComplete uses the object names defined in the application code, for instance, edit11
, button1
and so on. Open Applications are applications that provide the test engine with access to their internal objects, methods and properties. TestComplete uses the application-defined names as unique identification attributes of test objects. If the application-defined name of the tested object has been changed, you have to alter the mapping settings and use the new application-defined name.
The object’s position in the object tree was changed.
The object’s position in the object tree was changed.The object’s position in the object tree was changed.If the identification settings are correct, then perhaps the object resides on another level of the object tree than it did during test creation or recording. This happens if developers changed the tested application and added or removed some forms or controls. A typical example of this situation is when developers added a panel between the form and the missed button or when they remove the substrate panel between the form and the tested control.
If the object hierarchy has changed, then the general solution is to change your test or tests in order for them to match the new hierarchy. However, this can be a time-consuming task. If the object is mapped and is addressed in tests by its alias, then to solve the problem faster, you can update the name mapping tree:
-
Switch to the Project Explorer panel (you can do this by selecting View > Project Explorer from the TestComplete main menu).
-
In the Project Explorer, double-click the NameMapping item. This will invoke the Name Mapping Editor.
-
In the editor, expand the Mapped Objects section (by default, it is collapsed) and find the desired object in this section.
-
Drag the object to the needed level in the Mapped Objects tree.
If the object hierarchy changes from one application run to another, it is recommended to move the object to the highest level which it may occupy and command the test engine to search for the object from this level and deeper:
-
Drag the object to the highest level it may occupy.
-
Right-click somewhere within the Mapped Objects section of the Name Mapping editor and select Field Chooser from the context menu. This will open the list of available columns.
-
Drag the Extended Find column from the list to the Mapped Objects table.
-
Close the column list.
-
Select the Extended Find check box for the object. If a confirmation dialog appears, click Yes.
For more information on mapping object names, see Name Mapping.
One of the parent objects causes the ambiguous recognition problem.
One of the parent objects causes the ambiguous recognition problem.One of the parent objects causes the ambiguous recognition problem.If all the settings are correct and the object exists in the application at the moment TestComplete is addressing it, then perhaps there is an ambiguous object recognition in the tested application. For example, there is an ambiguity in the mapping of one of the object’s parent objects, and TestComplete cannot identify the object you are addressing. To solve this problem, we recommend that you eliminate the ambiguous recognition in the corresponding mapped object. For detailed information, see Message - Ambiguous Recognition of the Tested Object.
Other possible cases
The tested process was not found.
The tested process was not found.The tested process was not found.Check whether the tested process is running in the system. To identify processes, TestComplete uses their names and indexes. Verify that your test works with the process whose index coincides with the process index that you used when creating or recording the test.
The alias refers to a mapped object that is not in the NameMapping project item.
The alias refers to a mapped object that is not in the NameMapping project item.The alias refers to a mapped object that is not in the NameMapping project item.TestComplete logs the “Object does not exist” error if you are trying to access a method or property of an alias which is not associated with any mapping item (see Name Mapping). This may happen if you remove the mapping item from the Mapping Objects tree in the Name Mapping editor but keep the corresponding alias. For more information, see Handling the 'The alias refers to a mapped object that is not in the NameMapping project item.' Error.
The tested application stopped responding.
The tested application stopped responding.The tested application stopped responding.If the tested application has stopped responding to user actions and operating system’s messages, TestComplete is unable to find the required window or control. You can check whether the application is frozen in the Windows Task Manager. To display it, right-click an empty space in the operating system’s taskbar and select Task Manager from the context menu. In the Task Manager, switch to the Applications tabbed page and find the needed application on this page. If the application is frozen, the Status column will display Not Responding.
According to the Freeze Diagnostics properties of your test project, the test engine may automatically terminate an application if it stopped responding. If the test engine terminated the application, you will see the error message “The process does not respond. It will be terminated.” in the test log. In addition, TestComplete will automatically generate a detailed error report that will help you find the cause of the issue faster. For more information on how to view and change the Freeze Diagnostics properties, see Diagnosing Application Freezes.
The object tree model differs from the model that was used to create the test.
The object tree model differs from the model that was used to create the test.The object tree model differs from the model that was used to create the test.
-
For desktop applications
TestComplete supports two object tree models: Tree and Flat. Tests created for one of these models are not compatible with the other model. The Flat model was the default one in TestComplete 3 and earlier. Since TestComplete 4, the default tree model is Tree. If you run tests created for the Flat model, you may need to check which of the models is active. To do this:
-
Switch to the Project Explorer (you can do this by selecting View > Project Explorer from the TestComplete main menu).
-
Right-click your project in the Project Explorer and select Edit > Properties from the context menu. This will open the project editor and activate its Properties page.
-
Select General from the tree of property groups in the left part of the page. Check the value of the Object tree model setting on the right.
-
For web pages
If you are testing a web page, you may need to check the tree model which TestComplete uses for web objects (see Web Tree Models). To do this:
-
Switch to the Project Explorer (you can do this by selecting View > Project Explorer from the TestComplete main menu).
-
Right-click your project in the Project Explorer and select Edit > Properties from the context menu. This will open the project editor and activate its Properties page.
-
Select Open Applications > Web Testing from the tree of property groups in the left part of the page. Check the value of the Tree model setting on the right. The model must be the same as the model you used when creating the test.