Forum Discussion

kusterg's avatar
kusterg
Occasional Contributor
14 years ago

Dynamic Properties

I am working with a .Net application and  the widows are supposed to be ordinary windows objects.

In my application I register a new User and I get a confirmation window with the name of the user and its User ID.



For the displayed window itself it is mapped as

Aliases.Appl.dlg.

And no problem to access.



But the text on it seems to be a child and maps as:

Aliases.Appl.dlg.Static1

where the number changes each time I run the procedure.

TC refuses to compare the text.(The object does not exist).



My code is:



Call aqObject.CompareProperty(Aliases.Appl.dlg.WndCaption, cmpEqual, "New User Created", True)

Call aqObject.CompareProperty(Aliases.Appl.dlg.Static1.WndCaption, cmpEqual, "A new user has been created."&Chr(10)&"The user  name is: xx", True)

Aliases.HSE.dlg.btnOK.ClickButton



First and last line work fine, middle one does not: The object does not exist.

How can I make the code independent of the dynamic part?

1 Reply


  • Hi Gaby,





    The cause of this problem is that the 'Static1' object is mapped by the Name Mapping feature using a non-optimal set of properties. You need to modify the mapping criteria for this object to make TestComplete recognize it regardless of the dialog text. You can find information on this in the Modifying Mapping Criteria help topic.





    If you cannot find a way to map the object in the best way, please reproduce the problem, pack the entire project suite folder, and send us the archive directly via the Contact Support form.