I have a WPF application that uses Actipro's ToolWindows with tabbed containers. For a test I've written, I made a Ranorex recording that selects a tab in one of the ToolWindowContainers and then selects a row in a WPF DataGrid that's in the selected toolwindow. When playing the recording on my dev box, it works great.

However, when I tried running the same recording on my build machine (used primarily for nightly builds and checkin testing), Ranorex fails to find the control that's in the selected ToolWindow.

However, when using Ranorex Spy on my build machine, I only get an XPath of /form[@automationid='mainWindow']/container/container[4].

I get this wrong path regardless of where I press Ctrl+LWin within the ToolWindow. Note that the XPath doesn't even include the tool window itself (which is container[@automationid='packageVariablesWindow'] in the working XPath).

Interestingly, if I undock and redock the tab container, then Ranorex Spy correctly identifies the XPath to the ToolWindow's DataGrid.

Does anyone have an idea as to why Ranorex can discern the XPath on my dev machine but not on my build machine?

we think that the problem is dependent of the uiautomation framework from Microsoft. We've had problems with this framework time and time again, because it is not the best. We are working on an own plug-in, which is more comfortable than the Microsoft's one.
Which operating systems do you use on both, the dev and the build machine.
Maybe this is the crux of the matter, because the framework may work different on different operating systems.

Another interesting point is that the application has another ToolWindowContainer that only contains 2 ToolWindows. The top ToolWindow contains a few controls that Ranorex handles correctly on both my dev box and the build box. Is it possible that the number of ToolWindows in a container is a factor here, or could that just be coincidence?