Tree.Items Properties not set

Class library usage, coding and language questions.
PhilipL
Posts: 1
Joined: Thu May 09, 2019 12:48 pm

Tree.Items Properties not set

Post by PhilipL » Thu May 09, 2019 12:58 pm

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
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Tree.Items Properties not set

Post by odklizec » Fri May 10, 2019 8:21 am

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");
        }
    }
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration