0

I am trying to write a tool to automatically install a binary. Basically, I use comtypes and MSAA interface to interact with the installation windows and drive the installation procedure. When a window pops up, I recursively enumerate all elements on this window, pick the most appropriate element (typically a button) to interact, and so on. The tool sometimes works fine. But sometimes, it may take very long time in enumerating the elements (could be up to 1.5 mins for a window that is not very complex). And this problem seems to be timing related. It doesn't happy all the time. I have stuck on this problem for a week. Can someone help? Please!!!

One possibility I can think of is: while I am enumerating a window, this window is destroyed by the target application, then COM is mssed up and fails to do further navigation. Could it be a potential reason? I can't convince myself on this because the window is finally enumerated. If the window disappears during the enumeration, the traversal of the window element tree should fail, no?

user350466
  • 11
  • 4

1 Answers1

0

Try profiling the script until the issue occurs, then look through the profiling information to find out where the extra time is being spent.

Erik Cederstrand
  • 9,643
  • 8
  • 39
  • 63