A tale of two popups
Running a keyword test here, am wondering if it's possible to solve this without code.
I'm dealing with two popup windows on our website, one is start date, the other is end date. Both pop ups visually look exactly the same, but the problem is the idstr (which testcomplete is using to identify) is dynamic. Meaning it'll come up as cdk-overlay-1 the first time I identify start date, and overlay 2 the second time, or maybe end date will be overlay 1 the next time...
So I set idStr as cdk-overlay-*.... The problem is then that it identifies the objects ambiguously. Also if try to just delete one of the mappings and use cdk-overlay-* for both pop ups, it can only identify 1...even though the only identifier I'm using for both ObjectType Panel, and idStr cdk-overlay-*, and they both exist in the same spot in the mapping hierarchy.
I've looked at all the secondary properties, the only ones that are unique, are the ones that are dynamic, and using offset is extremely fragile.
Anyone know how I can either use the same mapping for both, or somehow differentiate between the two and still account for dynamic objects?
thanks for your time!
Hi,
Unless I missed something in your question... It is my understanding that both cdk-overlay-* popups exist on the page (thus causing objects ambiguity recognition) but only one of them is visible at the given moment of time. If the above is correct, does it help if additional Visible=True identification property is added to NameMapping?
(In the case if both cdk-overlay-* elements have Visible property set to true or false, you may consider to use Required Child functionality of NameMapping.)
It has to do with caching of mapped object, I believe. To improve performance, TestComplete caches a mapped object so that, if it is used more than once in the same test case, it doesn't have to be "found" again. So, what is probably happening is that the first time it is used, it gets the handle for the "start date" generated object and caches that. When you click the button for end date, it tries to use the cached value and probably gets lost in the process. A potential solution to this, if you're using the same mapped object more than once in a test case and there is a potential for it to be destroyed, recreated, reconfigure, etc., to call "RefreshMappingInfo" on that object before you try using it the second time.