Please, Could anybody help me to solve this problem? I'm trying to capture a tree menuItem using Coded UI,but when I captured it, the nodes weren't organized as a tree, they are all appering at the same level.
<Menu AutomationProperties.AutomationId="Menu" Height="25" VerticalAlignment="Top" Margin="0,0,299,0">
<MenuItem x:Name="menuFile" AutomationProperties.AutomationId="File" Height="25" Header="_File">
<MenuItem x:Name="menuItemClear" AutomationProperties.AutomationId="Clear" Header="_Clear">
<MenuItem x:Name="menuItemClearAll" AutomationProperties.AutomationId="Clear All" Header="_Clear All" />
</MenuItem>
<MenuItem x:Name="menuItemClose" AutomationProperties.AutomationId="Close" Header="_Close" />
</MenuItem>
</Menu>
Result expected:
\...\Menu
\...\Menu\menuFile
\...\Menu\menuFile\menuItemClear
\...\Menu\menuFile\menuItemClear\menuItemClearAll
\...\Menu\menuFile\Close
Coded UI captured:
\...\Menu
\...\Menu\menuFile
\...\menuItemClear
\...\menuItemClearAll
\...\Close