To reproduce:
1. Drag and drop RadTreeView on the form. Set the CheckBoxes property to true.
2. Add a Coded UI Test. Start the Coded UI Test Builder and select one of nodes.
3. In the UI Control Map is not exposed the Checked/CheckState properties and can not add a assertion
Workaround:
Add method which read the tree view xml file and check the state;
Assert.AreEqual(true, IsNodeChecked(uINode6TreeItem.Name, this.UIForm1Window.UIRadTreeView1Tree.TreeViewXml));
bool IsNodeChecked(string nodeName, string treeXMl)
{
XmlDocument treeXMLDocument = new XmlDocument();
treeXMLDocument.LoadXml(treeXMl);
foreach (XmlNode xNode in treeXMLDocument.ChildNodes)
{
if (IsChecked(nodeName, xNode.ChildNodes))
{
return true;
}
}
return false;
}
bool IsChecked(string nodeName, XmlNodeList nodes)
{
foreach (XmlNode xNode in nodes)
{
if (xNode.Attributes != null &&
xNode.Attributes["Name"] != null &&
xNode.Attributes["Name"].Value == nodeName &&
xNode.Attributes["CheckState"] != null &&
xNode.Attributes["CheckState"].Value == "On"
)
{
return true;
}
if (IsChecked(nodeName, xNode.ChildNodes))
{
return true;
}
}
return false;
}