How to refresh WPF AutomationElement with DataTemplate - Windows UI Automation
0
I am trying to automate the testing of a WPF application using Windows UI Automation. The application has a ContentControl with a data template that changes based on user interaction. On initial load, I am able to get and click a button inside of the content control. This switches the data template (the sub-controls are removed and replaced with other ones). However, when I look for the new controls in the automation element, they cannot be found. I am using the wrapper FlaUI, but I've also tried White and they both have the same sort of result. I am not using caching, but it seems like the window is somehow cached. Is there a way to reload the element or entire window so that I can retrieve the new controls.
c# wpf ui-automation
...