Reputation: 21558
I am running a test script in TestComplete v8. The object graph in memory gets out of date (as a dialog has appeared).
I run the following VBScript code
Sys.Process("iexplore").RefreshMappingInfo()
And I get the following error message...
Unable to find the object RefreshMappingInfo. See Additional Information for details.
The object with the specified attributes does not exist.
Possible causes of the error
This error relates to TC interpreting the method call as an attempt to find a control.
What is really odd.. If I connect to TC8 via COM and execute the same code, it works fine. So in ruby:
require 'win32ole'
tc = WIN32OLE.connect("TestComplete.TestCompleteApplication.8")
integration = tc.integration
Sys = integration.GetObjectByName("Sys")
puts Sys.Process("iexplore").Page("http://localhost:50563/x.aspx") _
.Form("form1").Panel("silverlightControlHost").Object(0).UIAObject("Popup").Exists
' This returns false
Sys.Process("iexplore").RefreshMappingInfo()
' No error raised
puts Sys.Process("iexplore").Page("http://localhost:50563/x.aspx") _
.Form("form1").Panel("silverlightControlHost").Object(0).UIAObject("Popup").Exists
' returns true
Why doesn't this work during a test? How do I fix it?
Upvotes: 0
Views: 769
Reputation: 3918
TestComplete has three object trees:
Objects in the Aliases tree reference objects in the NameMapping tree and objects in the later are referencing objects in the Sys tree. The RefreshMappingInfo method is used to refresh these references stored in objects of the NameMapping tree to objects in the Sys tree. So, the method exists only for objects from the NameMapping and Aliases trees.
In your code, you work with an object in the Sys tree: Sys.Process("iexplore"). You get an error since objects from the Sys tree does not have the RefreshMappingInfo method. You need either call the Refresh method or try working with an object from the NameMapping or Aliases tree. For example:
Upvotes: 1