How to identify WinForms DevExpress controls with AutomationId?
<p>We have inherited a big legacy WinForms application, that is using DevExpress controls <strike> (DevExpress.XtraNavBar.v8.1 and DevExpress.XtraEditors.v8.1)</strike> (I have been able to upgrade to version 15.1. It is a Project Converter tool oferred by DevExpress that allow you to use the latest DevEpress controls).</p>

<p>And there is a lot of pressure to stop doing manual testing and create an automation suite that will test the application. We have investigated the tools out there and <a href="https://github.com/TestStack/White" rel="nofollow noreferrer">White framework</a> is the best tool for our need.</p>

<p>The problem is with DevExpress controls because we cannot identify them at all. Although we are able to identify the parent of those controls. </p>

<pre><code>        var application = Application.Launch(@"C:\App\app.exe");
        var window = application.GetWindow(SearchCriteria.ByAutomationId("MainMDI"), InitializeOption.NoCache);
        var menu = window.Get(SearchCriteria.ByAutomationId("navBarMainMenu")); // this is the parent of those DevExpress controls


        // here throws an exeception because cannot find the 'Users' menu item (it is actually other text)
        var users = menu.Get(SearchCriteria.ByText("Users"));
        users.Click();
</code></pre>

<p><a href="https://i.stack.imgur.com/3Mmj5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3Mmj5.png" alt="Application menu with inspect.exe"></a></p>

<p>In the "inspect.exe" it shows that the parent has the children:</p>

<p><a href="https://i.stack.imgur.com/cvbPu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cvbPu.png" alt="Inspect.exe on menu"></a></p>

<p>And this is using "UI Automation Verify":
<a href="https://i.stack.imgur.com/59oe7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/59oe7.png" alt="enter image description here"></a></p>

<p><strong>UPDATE:</strong></p>

<p>I have tried by taking the children of the parent, but it returns me a list with zero items:</p>

<pre><code>        var application = Application.Launch(@"C:\App\app.exe");
        var window = application.GetWindow(SearchCriteria.ByAutomationId("MainMDI"), InitializeOption.NoCache);
        var menu = window.Get(SearchCriteria.ByAutomationId("navBarMainMenu"));


        System.Windows.Automation.AutomationElement automationElement = menu.AutomationElement;
        AutomationElementCollection automationElementCollection = automationElement.CachedChildren; // the collection is empty
        foreach (AutomationElement element in automationElementCollection)
        {
            string name = element.Current.Name;
            if (name == "Users")
            {
                // try to click on it
            }
        }
</code></pre>

<p><strong>UPDATE 2:</strong></p>

<p>I have upgraded the DevExpress to v15.2, but I still cannot find any Automation Id.</p>

<p>P.S: Sorry for the green rectangles, the client does not want to show anything from the application.</p>