I have a dialog which contains a treeview. The treeview contains a tree item which has a long string. I want to extract part of this string to use in validation at a later point in the test.
How do I access the string, and assign it to a variable? Do I use the RanorexPath? I am not currently familiar with how to go about this, so would appreciate an example that I could adapt.
Thanks
Extracting a string from a treeview - use RanorexPath?
Re: Extracting a string from a treeview - use RanorexPath?
Hi,
It's impossible to suggest something reasonable without seeing, at very least, a Ranorex snapshot (NOT screenshot) of the problematic element and whole tree. Could you please create the snapshot and publish it here?
It's impossible to suggest something reasonable without seeing, at very least, a Ranorex snapshot (NOT screenshot) of the problematic element and whole tree. Could you please create the snapshot and publish it here?
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
Re: Extracting a string from a treeview - use RanorexPath?
Hi Odklizec, my employer will not allow me to create a Ranorex snapshot, but I can show you the RanorexPath. In the path below, the values of '10000', '20000' and 'TEXTSTRING' are example values.
/form[@title>'[T.I.B] MyApp']/container[@controlid='10000']/form[@controlid='20000']//tree[@class='TreeView20WndClass']/?/?/treeitem[@text>'TEXTSTRING']
The main window is the form, with my initials on it (T.I.B). Then there is a container with a control ID of 10000 - this is the client area of the main window.
Underneath that is a form, its control ID is 20000.
The form displays the text in a treeview which I want to extract a string from.
In the form, the structure is as follows:
This form has a container, which is a ThunderRT6UserControlDC.
In this container there is an element.
Within that element is a TreeView20WndClass.
It has a treeitem which contains a string. In the path above, I've represented this as TEXTSTRING. The string will vary depending on the state of the database and some inputs in the test which are carried out before this form is opened.
During the testing so far, Ranorex has been able to drill-down and access the treeview, although the UI uses some old Visual Basic controls.
I hope this is sufficient information - I'm sorry I'm not permitted provide the Ranorex snapshot. Thank you for your help.
What I want to be able to do is read from the treeitem's TEXTSTRING into a variable, and then reference the variable's value later in the test procedure. I also need to allow for the fact that the contents of the TEXTSTRING may be different on different occasions, so I cannot assume or hard-code any variable values.
/form[@title>'[T.I.B] MyApp']/container[@controlid='10000']/form[@controlid='20000']//tree[@class='TreeView20WndClass']/?/?/treeitem[@text>'TEXTSTRING']
The main window is the form, with my initials on it (T.I.B). Then there is a container with a control ID of 10000 - this is the client area of the main window.
Underneath that is a form, its control ID is 20000.
The form displays the text in a treeview which I want to extract a string from.
In the form, the structure is as follows:
This form has a container, which is a ThunderRT6UserControlDC.
In this container there is an element.
Within that element is a TreeView20WndClass.
It has a treeitem which contains a string. In the path above, I've represented this as TEXTSTRING. The string will vary depending on the state of the database and some inputs in the test which are carried out before this form is opened.
During the testing so far, Ranorex has been able to drill-down and access the treeview, although the UI uses some old Visual Basic controls.
I hope this is sufficient information - I'm sorry I'm not permitted provide the Ranorex snapshot. Thank you for your help.
What I want to be able to do is read from the treeitem's TEXTSTRING into a variable, and then reference the variable's value later in the test procedure. I also need to allow for the fact that the contents of the TEXTSTRING may be different on different occasions, so I cannot assume or hard-code any variable values.
Re: Extracting a string from a treeview - use RanorexPath?
Hi,
I'm sorry, but without snapshot, I can only suggest you to search this forum and examine all available TreeView posts and eventually find the proper solution.
If you know how to uniquely identify a tree item, it should be enough to use either Get Value recording action or GetAttributeValueText("Text") coded action, to obtain the string from the tree item.
I'm sorry, but without snapshot, I can only suggest you to search this forum and examine all available TreeView posts and eventually find the proper solution.
If you know how to uniquely identify a tree item, it should be enough to use either Get Value recording action or GetAttributeValueText("Text") coded action, to obtain the string from the tree item.
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
Re: Extracting a string from a treeview - use RanorexPath?
Thanks Odklizec, I'll try the GetValue method you suggest.
-
- Posts: 3
- Joined: Mon Jul 04, 2022 10:44 am
Re: Extracting a string from a treeview - use RanorexPath?
I'm sorry, but without snapshot, I can only suggest you to search this forum and examine all available TreeView posts and eventually find the proper solution.
-
- Posts: 3
- Joined: Mon Jul 04, 2022 10:44 am
Re: Extracting a string from a treeview - use RanorexPath?
I'm sorry, but without snapshot,https://applicontech.com/#services
I can only suggest you to search this forum and examine all available Tree View posts and eventually find the proper solution.
I can only suggest you to search this forum and examine all available Tree View posts and eventually find the proper solution.