Hello,
I have custom table based on JavaFX TreeTable. Ranorex Spy recognizes it well. And indexes of selected TreeItems are indentified on Advanced tab under SelectionModel property, SelectedIndicies sub-property as a array of integers, like [2,3,5,7].
How can I get that values?
Thanks,
Bohdan
How to retreive custom property for JavaFX control
Re: How to retreive custom property for JavaFX control
Hi,
Could you please upload a Ranorex snapshot (not screenshot) of the problematic element? Without (at very least) snapshot, there is not much anyone here can do or suggest.
Generally speaking, obtaining processable data from Java elements is often a pain in the... My guess is, that in order to obtain the values you are after, you will most probably have to parse the property via custom code.
Could you please upload a Ranorex snapshot (not screenshot) of the problematic element? Without (at very least) snapshot, there is not much anyone here can do or suggest.
Generally speaking, obtaining processable data from Java elements is often a pain in the... My guess is, that in order to obtain the values you are after, you will most probably have to parse the property via custom code.
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: How to retreive custom property for JavaFX control
Thanks. Now please post an xpath pointing to the problematic element, which stores its values in an array. I can't find anything like you described. Each visible TreeItem contains list of cells, and those cells with text have correctly filled property Text. I just don't see property SelectionModel?
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: How to retreive custom property for JavaFX control
xPath for the TreeTable is /form[@title='Notifications']/container[@name='mainView']/?/?/container[@name='resourceBoxesPane']//container[@styleclass='mint-resource-notification-boxes-section']/container[@name='boxes']/?/?/container[@styleclass='body-area']/?/?/container[@name='outbox']/container[@name='outboxMasterPane']/container/container[2]/?/?/tree[@styleclass='tree-table-view mint-notification-table']
and maybe for better understanding i've attached screenshot:
https://www.dropbox.com/s/9hm38gfsuv893 ... X.png?dl=0
and maybe for better understanding i've attached screenshot:
https://www.dropbox.com/s/9hm38gfsuv893 ... X.png?dl=0
Re: How to retreive custom property for JavaFX control
Thanks. Now I see and understand. The problem is, that SelectionMode property is not expandable in saved snapshot
What I found interesting, that the individual TreeItems have Selected property. So in a theory, if the TreeItem is selected, its property should be set to True...except it is not I would suggest to discuss this behavior with your AUT developers. If the Selected property would be set correctly, it should be easy for you to create a list of treeitems, then go thought that list and evaluate Selected property of each treeitem. Otherwise, you need to process the SelectionModel>>SelectedIndicies property and somehow match the obtained values with selected TreeItems (probaly via element index?).
Anyway, as I mentioned, you will have to process this info via code. What I found interesting, that the individual TreeItems have Selected property. So in a theory, if the TreeItem is selected, its property should be set to True...except it is not I would suggest to discuss this behavior with your AUT developers. If the Selected property would be set correctly, it should be easy for you to create a list of treeitems, then go thought that list and evaluate Selected property of each treeitem. Otherwise, you need to process the SelectionModel>>SelectedIndicies property and somehow match the obtained values with selected TreeItems (probaly via element index?).
You do not have the required permissions to view the files attached to this post.
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: How to retreive custom property for JavaFX control
Thanks for your replay!
Actually i dive into custom property to identify somehow what treeitems is selected. Becease Selected property is not working well at this place.
I'm just wondering how Ranorex Spy retreive information into SelectionModel (SelectionIndicies []) property... if this info is available in Spy i guess it must be possible to retreive it in Ranorex code module. Am i right?
Actually i dive into custom property to identify somehow what treeitems is selected. Becease Selected property is not working well at this place.
I'm just wondering how Ranorex Spy retreive information into SelectionModel (SelectionIndicies []) property... if this info is available in Spy i guess it must be possible to retreive it in Ranorex code module. Am i right?
Re: How to retreive custom property for JavaFX control
Are you asking for this?
Object.Element.GetAttributeValueText("name_in_spy_tool")
E.g.
YourTreeObj.Element.GetAttributeValueText("SelectionModel")
Aracknid
Object.Element.GetAttributeValueText("name_in_spy_tool")
E.g.
YourTreeObj.Element.GetAttributeValueText("SelectionModel")
Aracknid
Re: How to retreive custom property for JavaFX control
Hi Aracknid,
Thanks for you replay.
To retreive list of SelectionModel sub-properties i use this code:
but i have no idea how to get sub-properties values. Any ideas?
Thanks
Thanks for you replay.
To retreive list of SelectionModel sub-properties i use this code:
Code: Select all
object oSelectionModel = treeAdapter.GetAttributeValue<object>("SelectionModel");
PropertyInfo piPropertyNames = oSelectionModel.GetType().GetProperty("PropertyNames");
Thanks
Re: How to retreive custom property for JavaFX control
Hi,
I think this post could help with accessing Dynamic properties?...
https://www.ranorex.com/forum/accessing ... tml#p44581
I think this post could help with accessing Dynamic properties?...
https://www.ranorex.com/forum/accessing ... tml#p44581
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: How to retreive custom property for JavaFX control
thanks odklizec!! it helps and made my day!
Re: How to retreive custom property for JavaFX control
Hi,
I'm glad it helped! Any chance you can post the code you put together? I think more examples like this would help other people too
I'm glad it helped! Any chance you can post the code you put together? I think more examples like this would help other people too
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: How to retreive custom property for JavaFX control
This piece of code resolved my problem:
Thanks for help!
Bohdan
Code: Select all
Tree treeAdapter = treeTableInfo.FindAdapter<Tree>();
JavaObjectWrapper selectionModelWrapper = treeAdapter.GetAttributeValue<JavaObjectWrapper>("SelectionModel");
string selectedIndices = selectionModelWrapper.GetObjectProperty("SelectedIndices").ToString();
Bohdan