Message - Unable to continue. The specified expression does not return an object...

Applies to TestComplete 15.73, last modified on March 04, 2025

When the Error Occurs

TestComplete displays this message if you specified some expression (or object name) for the Call Object Method keyword-test operation and that expression does not return an object, or it returns an object that does not contain any methods or properties.

You use the Call Object Method operation to call a method of some object from your keyword test. You may need to do that, for instance, to perform some action for which the Keyword Test editor does not offer a predefined operation.

In the Operation Properties dialog you need to specify an object whose method will be called as well as the method name and parameters. In order for the dialog to be able to provide you with information about available methods, it needs a valid reference to the desired object and that object must contain methods and properties. If these conditions are not met, TestComplete displays this message to inform you about the problem.

Possible Causes

  • If you typed an expression (or object) name, check it for misprints. For instance, you may misprint a process name or window title and TestComplete will fail to recognize the specified object in the operating system. If you find a misprint, correct it and try again.

  • The specified expression contains or returns an object that does not exist at the moment, when you were switching to the next page of the Operation Properties wizard. For instance, the specified window can be closed somehow by that moment, or the process can be terminated. TestComplete cannot find information on methods and properties of non-existing objects. To solve the problem, check if the desired object exists in the system (for instance, check that the desired window or control is visible on screen) and try again.

    Another typical example is that the specified expression includes the PopupMenu property. This property provides scripting interface to the context menu of some control only if that menu is visible. At design time this menu is hidden (even if you invoke this menu in your application, it will disappear after you switch to the TestComplete window), so you will not be able to work with its items through the PopupMenu property. To work with this menu, add the Menu Action operation to your keyword test.

  • To specify an object reference, you use a project or keyword-test variable that stores the reference. The fact is that these variables store object references only during the test run. At design time these variables store unassigned values. You cannot use these variables to specify parameters of the Call Object Method operation at design time.

    To solve the problem, try calling methods of the desired object using the Run Code Snippet operation.

  • It is also possible that TestComplete has no information on methods and properties of the object that the specified expression returns. This can happen if your tested application is an Open Application, the specified expression returns a reference to some native object and TestComplete was unable to obtain methods and properties of this object.

    This can happen for the following reasons:

See Also

Call Object Method Operation
About Keyword Test Editor
Object Properties, Fields and Methods That Are Unavailable to TestComplete

Highlight search results