Page 1 of 1

Tree.Items Properties not set

Posted: Thu May 09, 2019 12:58 pm
by PhilipL
Hey Guys,

I'm currently facing the following problem:

I have a TreeControl with ~20 TreeItems inside, when I track it via the Spy everything is displayed correctly:
2019-05-09_13h53_00.png
But when I'm trying to acces those TreeItems in code, it seems that some properties of the TreeItem objects are not set properly:
2019-05-09_13h54_14.png
Since the neither the text nor the location properties are set, I'm having a hard time clicking the TreeItem, any advice?
Thanks in Advance, Phil

Re: Tree.Items Properties not set

Posted: Fri May 10, 2019 8:21 am
by odklizec
Hi,

Unfortunately, without seeing the snapshot (NOT screenshot) of the tree and the code you are using, it's impossible to say what's wrong? My guess is, that you are accessing the tree incorrectly in code? Does your code looks like this?

Code: Select all

public void ProcessTree(RepoItemInfo treeItemsInfo)  // where treeItemsInfo points to repo element, with xpath pointing to list of tree items
    {
        IList <Ranorex.TreeItem> treeItemsList = treeItemsInfo.CreateAdapter<Ranorex.TreeItem>(false);
        foreach (Ranorex.TreeItem treeItemSingle in treeItemsList )
        {
            string treeItemText = treeItemSingle.Element.GetAttributeValueText("Text");
        }
    }