I am trying to debug some scripts (that use Windows UI Automation support to identify GUI object) that I have developed and that are failing intermittently because they cannot find certain controls in the tree. I'm using also screenshots to check the state of the window that I'm testing and it seems that the controls are there in GUI, but my search inside the tree does not find them (even after a few seconds of sleep). When I use inspect.exe to check the tree, the objects are there.
Is there a way to dump that tree for later analysis? The only way I found until now is by crawling the whole tree recursively, but this is not feasible as it takes an awful lot of time.