i try like this ,but the object 'box_c' return null
Code: Select all
string str_temp = "/form[@title='Form1' and @processname='test_tree' and @controltypename='Form1' and @instance='0']/container[@controlname='splitContainer1']/?/?/tree[@controlname='treeView1']//treeitem[@accessiblename='Node5']";
Ranorex.TreeItem tree_item = null;
bool aa = Host.Local.TryFindSingle<Ranorex.TreeItem>(str_temp, 5000, out tree_item);
if (aa)
{
object box_c = tree_item.Element.GetAttributeValue("BackColor"); // return null
Color cl = (Color)box_c;
}