FlaUI icon indicating copy to clipboard operation
FlaUI copied to clipboard

Question: What is the equivalent of getting a new snapshot of a cache in FlaUI?

Open kmgallahan opened this issue 2 years ago • 0 comments

As per the title, what is the equivalent of getting a new snapshot of a cache in FlaUI?

https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-cachingforclients#retrieving-a-new-snapshot-of-the-cache

https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/caching-in-ui-automation-clients#updating-the-cache

I've created a cache and think it is working because I can access the CachedChildren property of an element and retrieve Names and Values.

This is contained in a using CacheRequest block and takes ~250ms to execute.

If I simply grab and save IValuePattern references, then later use .Value on them I get the same new data but it takes ~40ms.

I feel like I'm missing something regarding reusing the cache to grab a new snapshot of the values... the examples don't show re-using the CacheRequest. Perhaps the cache is saving many more values each time so it is just inherently slower if you don't need all the data (using TreeScope.Descendents), or if you are only working with a small number of items (vs. a 20 row grid).

kmgallahan avatar Jan 04 '22 17:01 kmgallahan