I have an application using a WPF RadTreeView control. I try to control the RadTreeView using a Coded UI Test.
Now I found out that the Playback is only able to find nodes of an RadTreeView which have already been displayed in the application. Given
a tree that looks like this:
Node1
Node11
Node12
Node2
Node21
Node22
After application start the RadTreeView only displays the top level nodes:
Node1
Node2
When I now try to find the 'Node11' control:
WpfRadTreeViewItem node = _AppWindow.Navigation.GetNode("Node11");
Click(node);
I get the error: 'The playback failed to find the control with the given search properties'. However, after expanding the Node1 and Node2 manually (and closing them again), the playback is able to locate the control (even if it is not currently displayed in the navigation tree).
I assumed that this is related to the "LoadOnDemand" feature of the RadTreeView, so I tried to set the 'IsLoadOnDemandEnabled'
and the 'IsVirtualizing' properties of the RadTreeView to 'False', but that did not change the behavior.
Is there a way that playback find's the control even if it has been not yet displayed in the navigation tree?
Is there a way to force the RadTreeView to load all subitems even if they are not yet displayed?
While searching for a workaround I tried to expand the root nodes by setting the 'IsExpanded' property to 'True':
WpfRadTreeViewItem node = _AppWindow.Navigation.GetNode(target);
node.IsExpanded = true;
However, if I do this, I get another error 'SetProperty of "IsExpanded" is not supported on control type: TreeItem'.
Why do I get this error?
What can I do to expand the Node by the Playback?
(Klicking on is no good idea since the node may already be expanded.)
Thanks and best regards,
Claudio
Now I found out that the Playback is only able to find nodes of an RadTreeView which have already been displayed in the application. Given
a tree that looks like this:
Node1
Node11
Node12
Node2
Node21
Node22
After application start the RadTreeView only displays the top level nodes:
Node1
Node2
When I now try to find the 'Node11' control:
WpfRadTreeViewItem node = _AppWindow.Navigation.GetNode("Node11");
Click(node);
I get the error: 'The playback failed to find the control with the given search properties'. However, after expanding the Node1 and Node2 manually (and closing them again), the playback is able to locate the control (even if it is not currently displayed in the navigation tree).
I assumed that this is related to the "LoadOnDemand" feature of the RadTreeView, so I tried to set the 'IsLoadOnDemandEnabled'
and the 'IsVirtualizing' properties of the RadTreeView to 'False', but that did not change the behavior.
Is there a way that playback find's the control even if it has been not yet displayed in the navigation tree?
Is there a way to force the RadTreeView to load all subitems even if they are not yet displayed?
While searching for a workaround I tried to expand the root nodes by setting the 'IsExpanded' property to 'True':
WpfRadTreeViewItem node = _AppWindow.Navigation.GetNode(target);
node.IsExpanded = true;
However, if I do this, I get another error 'SetProperty of "IsExpanded" is not supported on control type: TreeItem'.
Why do I get this error?
What can I do to expand the Node by the Playback?
(Klicking on is no good idea since the node may already be expanded.)
Thanks and best regards,
Claudio