Forum Discussion
5 Replies
- AlexKaras
Champion Level 1
Hi,
No way.
TestComplete operates with the objects that are provided by the tested application. When the object is destroyed in the tested application TestComplete cannot access it because the object does not exist anymore.
- maxtesterContributor
My tested application is a WPF- application with plenty dialogs. For example I create something in one dialog and beed to verify severall informations in another. Or I need to make some database calls based on the informations. To keep my automation and functions within a dialog unit as dynamic as possible I want to return as much informations as possible. So the easiest way is to return the objects which I need for further verifications or actions. I do not need the methods but only the properties. I have created a function which gets all properties from the object. This is ok for me
- AlexKaras
Champion Level 1
Hi,
Yes, this is the way to go. Initial objects from the tested application cannot be persisted in TestComplete, so you must create copy of the data that you need later. Depending on your test project scripting language, data may be preserved as a file, JSON object, a temporary Project Variable of Table type, etc.
- maxtesterContributor
Ok, so the only way is to make a copy of the object. I tried it with lodash but it fails. I think that I need to create a function which copies only the properties
- tristaanogreEsteemed Contributor
What is the reason why you need access to the object after it is closed in the application? Are you doing validation against it? Are you using information from it for other tests? It depends upon what you're looking at doing as to what the better solution is.