Page 1 of 1

TreeItem loses descendants

Posted: Tue Nov 10, 2009 4:30 pm
by vshulman
Given the following code:

Tree tree = repo.MyForm.Self.FindSingle("/*/*/element[@controlname='Tree']/tree[@accessiblerole='Outline']");

TreeItem root = tree.FindSingle("treeitem[@accessiblename='MyRootNode]");

I find that the TreeItem root has no children or other descendants; even though the same node in the tree itself has all the proper descendants -- please see the attached screenshot.

Thanks,
Victor.

Re: TreeItem loses descendants

Posted: Wed Nov 11, 2009 6:10 pm
by Support Team
Sorry, I could not reproduce that problem. I tried reproducing it with Ranorex 2.1.4 and a WinForms TreeView control.

What Ranorex version do you use?
What kind of application is it you automate? Could you provide/attach a snapshot of the tree (see http://www.ranorex.com/support/user-gui ... html#c2072)?

Regards,
Alex
Ranorex Support Team

Re: TreeItem loses descendants

Posted: Thu Nov 12, 2009 7:18 pm
by vshulman
I am using Ranorex version 2.1.4.6779; and the application I am working with is based on Infragistics UI objects -- perhaps, that is the problem?

Re: TreeItem loses descendants

Posted: Fri Nov 13, 2009 12:38 pm
by Support Team
You are correct, it could be the because of how the control is implemented. You can use Ranorex Spy to look at the structure hierarchy of the control. If you still think there is a problem after looking at the control in Ranorex Spy, you could send us a snapshot of your app using the save snapshot functionality of Spy.

http://www.ranorex.com/support/user-gui ... html#c2072

Ron
Ranorex Team

Re: TreeItem loses descendants

Posted: Wed Jun 16, 2010 3:25 pm
by DirkB
Hi,

I have a common WinForms TreeView which looses Descendants (Ranorex 2.3)
Ranorex.Tree tv1 = getRanorexPath("tree","treeView1");
List<TreeItem> listTI = (List<TreeItem>)tv1.DescendantItems;
foreach (TreeItem TI in listTI)
{
TI.Click();
}
If I select/click Parent TreeItems everything is fine (e.g. 18 Items with correct Text property)
If I select items without childs these items have a Text property == null and cannot be clicked.

By the way: Spy reports correct items in each case.

Regards
Dirk

Re: TreeItem loses descendants

Posted: Wed Jun 16, 2010 3:55 pm
by Support Team
Hi,

I've tried it too with a standard Win Forms tree view and I cannot reproduce your behavior.
Is it possible to post or send ([email protected]) us an example application including this behavior?
What code is inside your method getRanorexPath()?

Regards,
Peter
Ranorex Support Team

Re: TreeItem loses descendants

Posted: Tue Jun 29, 2010 1:08 pm
by DirkB
Hi Peter,

I try to get a reduced implementation from our customer to let you see what's going on.

The method
String getRanorexPath ()
...
Dictionary<String, String> myDic = guiRepository[activeFormName];
result = activeFormText+@"/"+myDic[ControlName];
---
has a list to all xpaths within a "activeFormName" and is our own repository.
It returns a simple xpath for further stimulation.

But don't worry - it's not urgent anymore.

Regards
Dirk