Forum Discussion
Could there be other calculations or objects loading in the background before that particular message box appears?
If you are using that same bit of code for all the message boxes, then I would suspect that there's something different about that particular box.
- sergi10 years agoContributor
No, there's no background work ongoing.
If I do the following, the second time I try to find that view it's immediate.
No matter if the MessageBox is already being displayed when I execute my code or I do something to make the MessageBox be displayed, it takes almost 2 seconds to find it.
var base = Sys.Process("MyProcessName"); // This takes ~1900ms base.FindChild("ClrClassName", "MessageBoxView", 3); // This takes ~50ms base.FindChild("ClrClassName", "MessageBoxView", 3);
- Marsha_R10 years agoModerator
It makes sense that the second one would be faster because whatever is holding up the object isn't a problem any more by the time the first one executes.
Try putting a Delay=2000 right before the first one and see what happens.
- sergi10 years agoContributor
I already tried putting a delay before and it made no difference at all.
We could argue whether it makes sense that the second time is faster, but it doesn't make any sense that it takes so long to succesfully find a view that is already visible and in the first or second level of the root view.
The same behaviour is observed when using the fullpath of the object.
Related Content
- 9 years ago
Recent Discussions
- 9 hours ago