My WPF application implements prism framework. There are few menu controls which get loaded to the container as the page changes. I am trying to use Coded UI, to add assertions to these buttons.
When CUIT is used on first screen, nothing seems to be recognized. But on second screen they get recognized. There is no change in the code for loading them except that the controls are one level deep on the first screen (that's what snoop shows).
Do I need to still have Automation peers code to be written at source code end to expose the controls though they are standard WPF controls?
What else can I try to get them recognized consistently?
Inspect.exe, UIA Verify, Snoop display all the WPF controls irrespective of the screen I am in.
Thread.Sleep()before loading the first screen