Forum Discussion
One thing up front... in the "Else" block, you don't need the additional "if object" for not exists... that's what "Else" does... your first "if object" checks for existance... if exists is true, it executes that block of operations... if not, whatever is under the "else" executes so you don't need to recheck.
Secondly, it's not clear what the "Exists[Get]" on a different page object is intended to do. You're just getting the property value but then it's not obvious what you're doing with it.
Now, all that said... It would be interesting to see two things... first, what are the actual parameters for your initial "If object" statement... could you give us a screenshot of what's inside there? Secondly, what is actually being executed in the two code blocks (the initial "if object" and the "else"). What it SOUNDS like, as has been hinted by others here, is that your object that you are checking may be getting dynamically destroyed and recreated somehow. One of the things that TestComplete does is it caches objects that have been namemapped. So, if an object is destroyed and recreated, some of the handles and everything may not be valid the next time through. This is where calling "RefreshMappingInfo" on some parent object (such as the page) would make sure that TestComplete has a "clean" picture of the objects present. Try adding that operation on the pagePiLeaseSearch before you're "if exists" and see if that helps.
Related Content
- 13 years ago
- 8 years ago
- 8 years ago
Recent Discussions
- 14 hours ago