mathieuleb
11 years agoContributor
Name mapping refresh problem
Hi, we use a custom control to handle different action base on the context. Each control have a unique ID, but the name mapping doesn't seem to work correctly when we reuse a control.
ex:
Control1 in context X: ID 190014
Control1 in context Y: ID 30147
The problem is that, the name mapping always identify the object no matter if we are in context X or Y.
And if I add remove/add field in the name mapping editor, the value change..
ex:
Control1 in context X: ID 190014
Control1 in context Y: ID 30147
The problem is that, the name mapping always identify the object no matter if we are in context X or Y.
And if I add remove/add field in the name mapping editor, the value change..
- If I'm understanding you correctly, you have 2 different IDs to identify the same object at different points. Name mapping allows that, but you need to enter Conditional Mode (the button on the lower-left) and construct the different variations. Once you've done that, it should work as expected.
It makes sense when you think about it from TestComplete's perspective. You have an object on the screen identified by an ID. When the application changes the ID of the object (even if it's really the same object), TC doesn't see the object any more.
The reason the ID changes when you re-add the property is because TC is populating the value with what's available at the time you map it. Apparently, that's different when you're re-adding vs when you mapped it originally.
And you may already be doing this (or if I'm completely missing what you're saying), I always like to throw in a mapping refresh before I call something when objects change without a full page refresh:
aliases.objectName.refreshMappingInfo