Can't reach TreeItem's nodeParameters

Ask general questions here.
ozzs
Posts: 4
Joined: Mon Nov 13, 2017 2:15 pm

Can't reach TreeItem's nodeParameters

Post by ozzs » Mon Nov 13, 2017 2:33 pm

Hi,

I'm trying get text, cell information of my TreeItem but I can't get any information of it. Tracking the TreeItem and adding it to the my repository.

Using this method:

public bool findTreeItemInTree(Tree myTree, String itemName)
{
IList<TreeItem> myItems = myTree.Find<TreeItem>(".//treeitem", 1000);
foreach (TreeItem myItem in myItems)
{
if (myItem.Text == itemName)
return true;
}
return false;
}

myItem's text attribute is null. On the other hand, when I check my TreeItem on Ranorex Spy's Advance tab all information can be seen on NodeParameter side.

My question is How can I reach the informaiton on NodeParameters?

Regards,
Ozmert

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

Re: Can't reach TreeItem's nodeParameters

Post by odklizec » Mon Nov 13, 2017 7:11 pm

Hi,

Please post a Ranorex snapshot (NOT screenshot) of the problematic tree element. Without, at very least, snapshot, it's pretty hard to provide a reasonable help. Thanks.
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

ozzs
Posts: 4
Joined: Mon Nov 13, 2017 2:15 pm

Re: Can't reach TreeItem's nodeParameters

Post by ozzs » Tue Nov 14, 2017 6:40 am

Hi,

My Ranorex version 7.2.0 the problem was occurring in the older version as well,
OS: Windows 7,
Hardware: i7, 16GB Memory, onboard gpu card.

Because of the content of the project I can't share further information. If you can tell me something to try to reach the information on nodeParameters, I'll be appreciate that. Thanks.

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

Re: Can't reach TreeItem's nodeParameters

Post by odklizec » Tue Nov 14, 2017 8:56 am

Hi,

I'm afraid, I'm not able to help without snapshot. Without knowing structure of the tree in question, I'm unable to tell how to access its attributes. All I can do for you in situation like this, is to suggest to search this forum for all tree-related topics and try to find something useful from them.

If you cannot provide a snapshot taken directly from your app, then ask developers of your app to prepare a small sample app, from which you can get the snapshot. Another possibility is to edit the snapshot from your production app and replace/delete all sensitive data before posting it here. Unzipped snapshot is a xml file anyway ;)
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

ozzs
Posts: 4
Joined: Mon Nov 13, 2017 2:15 pm

Re: Can't reach TreeItem's nodeParameters

Post by ozzs » Fri Aug 17, 2018 1:13 pm

Hi,

I'm still facing this problem. I prepared a snapshot. You can see the strucrture of the tree item. I want to get the value of the nodes but I can't.

My Ranorex version 8.1.2 the problem was occurring in the older version as well,
OS: Windows 7,
Hardware: i7, 16GB Memory, onboard gpu card.

Regards,
Özmert
Attachments
TreeItemSample.rxsnp
(128.75 KiB) Downloaded 7 times

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

Re: Can't reach TreeItem's nodeParameters

Post by odklizec » Fri Aug 17, 2018 2:21 pm

Hi,

I'm afraid, this is a pretty unusual implementation of tree and this is why the code you tried fails. As I can see in the snapshot, there is no way to extract the individual cells from the tree items? Maybe someone more experienced with JTree can suggest something? The only thing I can suggest is to enable the Java SWT legacy automation mode...
java.png
java.png (12.06 KiB) Viewed 134 times
BTW, a pretty similar issue to yours has been discussed here:
viewtopic.php?f=4&t=11167&p=44990#p44990
Simply, the tree you want to automate, is not pretty test automation-friendly and needs to be enhanced, with focus to test automation.
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