This topic explains how to diagnose and resolve the “There was an attempt to perform an action at point (X, Y) ... ” errors that occur during the test run.
About the Error Message
The test engine posts this message to the test log when the action that you want to perform at a specific point fails because the test engine cannot access that point. The message indicates that something has changed in the application under test and its state differs from the state it was in while the test was being created or recorded.
Diagnosing the Problem
-
Find the first error message in the test log. Depending on the command being executed, TestComplete may post several error messages to the log. This happens due to certain specifics of the test and script engines functioning (the script engine is used even when you run keyword tests, not scripts). Typically, the first error message corresponds to the problematic command and further errors are caused by this first error. The instructions in this topic assume that the first error message is “There was an attempt to perform an action at point (X, Y)...”.
-
Activate the Details panel of the generic test log page. The panel may contain additional information on the error: for example, the name of the control to which the target point belongs, the window size, the top left corner and bottom right corner coordinates and the screen coordinates of the target point.
-
To better understand what test command was executed when the error occurred, double-click the error message in the test log. TestComplete will open your test for editing and automatically highlight the line that was executing when the error occurred.
-
Explore properties of the desired objects, find the cause of the problem and fix it. See below for details.
Exploring Properties
In order for you to be able to explore the object, the tested application must be running. If the application was terminated after the test is over, run it again and pause the run on the problematic test line. To do this:
-
Set a breakpoint on the line that was executed when the error occurred.
If you have not opened the test for editing yet: double-click the error message in the test log. TestComplete will open your test for editing and highlight the line that was executed when the error occurred.
To set the breakpoint, simply click the editor’s gutter next to the line, or press F9. After the breakpoint was set, the line will be highlighted with red.
-
Run your test. The test engine will automatically pause the test execution when it reaches the breakpoint.
For more information on breakpoints and debugging, see Debugging Tests.
Now you can explore the application under test:
-
If you are testing a mobile application, open the Mobile Screen window. To do this, click Show Mobile Screen on the TestComplete Test Engine toolbar.
-
Select Display Object Spy from the Tools toolbar. This will invoke the Object Spy window.
-
Use the Object Spy window to select the desired object on screen or in the Mobile Screen window. To do this, drag the target glyph () to that object. While dragging, TestComplete will highlight objects under the mouse cursor with the red frame. Release the mouse button when the cursor is over the desired window or control and TestComplete highlights this window or control with the red frame. The Object Spy window will display the object’s properties.
If you need to select a popup object like a hint or a menu item, then you should use another selection mode: click in the Object Spy window and perform the actions needed to display the desired object on screen or in the Mobile Screen window. When the object is visible, hover the mouse over it and press Shift+Ctrl+A to “fix” the object (the shortcut can be changed in TestComplete options). The Object Spy window will display the object’s properties.
-
Click Highlight Object in Object Tree. This will select object in the TestComplete Object Browser panel.
Possible Causes of the Problem
Below are typical causes of the problem and typical ways to eliminate them.
Inappropriate coordinates of the specified point at which you perform an action.
Inappropriate coordinates of the specified point at which you perform an action.Inappropriate coordinates of the specified point at which you perform an action.If you perform an action at a specific point (for example, Button.Click(X, Y)
), make sure that these coordinates are within the object’s bounds.
The specified point belongs to a transparent area of the object.
The specified point belongs to a transparent area of the object.The specified point belongs to a transparent area of the object.If the specified point belongs to a transparent area of the object, the test engine cannot perform an action at the point. Make sure that the specified point coordinates are within the non-transparent area of the object.
The specified point is overlapped by another control or window.
The specified point is overlapped by another control or window.The specified point is overlapped by another control or window.For information on how to handle overlapping windows, see Handling Unexpected Windows.
The object’s identification properties are not valid.
The object’s identification properties are not valid.The object’s identification properties are not valid.Description of a cause
To recognize windows and controls, TestComplete uses a number of properties that identify the object among its siblings. If the values of identification properties are no longer valid, or they do not provide unique recognition, TestComplete may select a wrong object that matches the current values of identification properties. In this case, all the actions that must be performed over the object, will be performed over the wrong object, which may cause an error.
Revising the identification properties
To determine the identification property values, select the MappedName
property of the object in the Object Browser panel and click the button. This will display the Name Mapping Item Information dialog box in which you view the mapping settings.
If the properties do not match the expected values or do not provide unique identification of the window or control, you need to change the mapping settings criteria. To do this:
-
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.
-
Select the object in the Mapped Object tree. The list of mapping settings that are used for this object will be shown on the right. You can modify the settings directly in list.
If you need to add more properties to the mapping settings, then you have to re-map the object. For detailed information on this, see Mapping Application Objects.
Before mapping the object, you may need to remove the existing mapping item and alias. To keep your tests working, you can assign the same alias to the newly mapped object. See Name Mapping - Aliases.
Some tips
-
If the identification criterion includes the Index
property and the value of this property has changed, then do not use this property for mapping as 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 those properties that can be used to identify the object uniquely.
Note that 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.
-
We recommend that you add the Visible = True
and/or VisibleOnScreen = True
properties for window or control identification. This may help you avoid the problem if it occurs due to the above-mentioned reasons.
-
Do not use the Name
and FullName
properties for object identification.
-
You can use wildcards (*
and ?
) or regular expressions to specify variable parts of the string property values. ?
stands for any single character, *
- 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 the string type like WndClass
or wText
.
-
If you test an Open Applications: Open Applications provide the test engine with access to their internal objects, methods and properties. To map objects of these applications, TestComplete uses the object names defined in the application sources, for instance, edit11
, button1
and so on. If this name has been changed, you have to alter the mapping settings and use the new application-defined name for your tested object.
Incorrect identification properties of the object’s parents
If the object’s identification properties are valid, but this error message still arises, another possible reason is that values of identification properties of the object’s parents are no longer valid. For more information, please see the description of how to solve problems with the object’s identification properties above.
If it is impossible to set valid identification properties of the object’s parents, we recommend moving the desired object to the highest level of the mapped object hierarchy that it may occupy and command the test engine to search for the object from this level and deeper. To do this:
-
Open NameMapping project item in the Project Explorer panel to open the Name Mapping editor.
-
Find the desired object in the mapped object hierarchy, and drag the object to the highest level it may occupy.
-
Select the Extended Find check box for the object. This will command the test engine to search for the object starting from this level and deeper.
Note: |
The Extended Find column are hidden by default. To make it visible, right-click somewhere within the Mapped Objects panel and select Field Chooser from the context menu. This will display a list of available columns. Drag the Extended Find column from this list to the panel. |
To learn more about the Extended Find feature, see Using Extended Search Criteria in Name Mapping Repository.
TestComplete and a tested application have different privilege levels.
TestComplete and a tested application have different privilege levels. TestComplete and a tested application have different privilege levels. This can happen if the uiAccess attribute of the TestComplete manifest is set to false or isn't specified, and the same attribute of the tested application’s manifest is set to true. To resolve this issue:
See Also
Other "Object Not Found" Errors
Name Mapping
Object Browser Naming Notation
About Object Browser