Hi folks,
I have a SysTreeView with some rawtext elements. I want to identify a rawtext element (just row, column is fixed) based of a column/row coordinates of another rawtext. Unfortunately, Ranorex currently does not support SysTreeView with multiple columns, so I'm forced to use rawtext for element identification.
The element I want to identify has a variable content so this is why I cannot use rawtext for its identification. However, there is a neighbor element, with fixed text, so I think it would be an ideal starting element for identification of element in question. Sadly, I cannot find a way how to configure xpath to identify my problematic element. Here is a screenshot:
And here is snapshot:
I can easily identify "Volume" RawText. The problem with neighboring cell is that its row is always -1 of the "Volume" row. Column is not a problem as I know it will always be 6. Any idea how to identify that "variable" cell using xpath?
how to identify rawtext based of another rawtext
how to identify rawtext based of another rawtext
You do not have the required permissions to view the files attached to this post.
Last edited by odklizec on Mon Feb 10, 2014 5:22 pm, edited 1 time in total.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: how to identify rawtext based of another rawtext
Hi odklizec,
Unfortunately you forgot to attach the Ranorex snapshot and we are not exactly sure which cell you want to access. Please give more details concerning your issue.
Regards,
Robert
Unfortunately you forgot to attach the Ranorex snapshot and we are not exactly sure which cell you want to access. Please give more details concerning your issue.
Regards,
Robert
Re: how to identify rawtext based of another rawtext
Hi Robert,
Thank you for the reply! Silly me
Snapshot is now available.
Thank you for the reply! Silly me

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: how to identify rawtext based of another rawtext
Hi,
Thanks, now it works!
In order to get the “neighbor” element of “Volume” you can use either:
Or
Or
But the last solution is just suitable, if there is only one “mm3” field within your application so I would rather use the first or second solution.
Regards,
Robert
Thanks, now it works!
In order to get the “neighbor” element of “Volume” you can use either:
Code: Select all
//tree[@class='SysTreeView32']//following-sibling::rawtext[][1]
Code: Select all
//tree[@class='SysTreeView32']//following-sibling::rawtext[@row='2']
Code: Select all
/form[@title='LiteBox3D']//rawtext[@rawtext~'.*mm3']
Regards,
Robert
Re: how to identify rawtext based of another rawtext
Hi Robert,
Thanks for the reply. Unfortunately, neither solution is what I'm exactly looking for
The problem of the first solution is, that it rely on exact index number of volume value rawtext. So if the index changes, the path may return wrong rawtext.
The second solution, using the row index, is very close. Unfortunately, as I mentioned above, I cannot be sure the row index is always the same. It may change during the systree manipulation. The only thing I'm quite sure is, that the Volume value rawtext (0mm3) row is "Volume" RawText row-1 and column is "Volume" RawText column+1
In other words, if the "Volume" rawtext Column=5 and Row=3 then the Volume value rawtext Column=6 and Row=2.
So I hoped to be able to identify the Volume "value" col/row based of the "Volume" rawtext col/row.
e.g. //tree[@class='SysTreeView32']/rawtext[@rawtext='Volume']what-to-put-here-to-identify-volume-value-col-row
So far, it looks the third solution is the best one, sadly, it's good just for mm3 and mm2 but not for the last row, which contains combined text. But maybe I can somehow use regexp to identify that last rawtext?
Thanks for the reply. Unfortunately, neither solution is what I'm exactly looking for

The problem of the first solution is, that it rely on exact index number of volume value rawtext. So if the index changes, the path may return wrong rawtext.
The second solution, using the row index, is very close. Unfortunately, as I mentioned above, I cannot be sure the row index is always the same. It may change during the systree manipulation. The only thing I'm quite sure is, that the Volume value rawtext (0mm3) row is "Volume" RawText row-1 and column is "Volume" RawText column+1
In other words, if the "Volume" rawtext Column=5 and Row=3 then the Volume value rawtext Column=6 and Row=2.
So I hoped to be able to identify the Volume "value" col/row based of the "Volume" rawtext col/row.
e.g. //tree[@class='SysTreeView32']/rawtext[@rawtext='Volume']what-to-put-here-to-identify-volume-value-col-row
So far, it looks the third solution is the best one, sadly, it's good just for mm3 and mm2 but not for the last row, which contains combined text. But maybe I can somehow use regexp to identify that last rawtext?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: how to identify rawtext based of another rawtext
Hi,
In order to get the desired element please use following code sequence:
Regards,
Robert
In order to get the desired element please use following code sequence:
RawText a = "//tree[@class='SysTreeView32']/rawtext[@rawtext='Volume']"; rowHelper = a.Row; rowHelper -= 1; columnHelper = a.Column; columnHelper += 1 RawText b = @"//tree[@class='SysTreeView32']/rawtext[@column='" + columnHelper + "' and @row='" +rowHelper +"']";The row index is decremented by one and the column is incremented by one starting from the “Volume”-element.
Regards,
Robert
Re: how to identify rawtext based of another rawtext
Hi,
Thanks for the code sample! I somewhat hoped there is a way to solve my problem using the repository (to be able to test the cells with spy), but I can live without it. Your solution seems to be perfect for playback identification and that's all I really need
Thanks again!
Thanks for the code sample! I somewhat hoped there is a way to solve my problem using the repository (to be able to test the cells with spy), but I can live without it. Your solution seems to be perfect for playback identification and that's all I really need

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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