Page 1 of 1

Need to retrieve List attribute of Live Elements (JavaList)

Posted: Mon Jun 04, 2018 8:43 pm
by subrata1
Thanks in advance... I have attached the screen shot for better understanding...
I am very new to this Ranorex and VB.Net world. I appreciate any feed back towards this
issue.

Problem Description -
I have javalist (total 29 items) to go thru and read its 'Live Element' attributes.
I can loop thru the entire list item (I got 29 of them). However, I am not quite sure how to get Live element of an attribute. I am using vb.net.

Private Sub Init()
' Your recording specific initialization code goes here.

Dim RanorexList As Ranorex.List
RanorexList = "/form[@title='GAR1']/container[@name='m_introPanel']//container[@name='cmConversionRatePanel']/container[@name='cmConversionRatesMaintenance']/?/?/list[@name='cmConversionRatesMaintenance']"
Dim count As Integer
Dim i As Integer
count = RanorexList.Items.Count
Delay.Milliseconds(10)
For i=0 To count-1
Dim myItem As String
myItem = RanorexList.Items(i).Text
MsgBox(myItem)
'myItem is returning (com.ebsdr.bn.bp.subsystems.credit.untrusted.CurrencyRateC@cbdef5)
'However, I need to capture attribute value of 'Name' property.

Next


End Sub

Re: Need to retrieve List attribute of Live Elements (JavaList)

Posted: Mon Jun 04, 2018 9:13 pm
by Support Team
Hello subrata1,

I hope you found my email earlier today was able to help you get the values from the list of items you have. If not, please reply to the open support ticket and I will be happy to further assist you. In the meantime, I have copied my emailed response below to help any other users experiencing the same issues.
You can get the attribute value through a simple Get value action as depicted below.
1.png
Since you are working in code, you can convert this to user code and implement this auto-generated code into your own code.
2.png
This uses the following API call and should help you get the attribute value of an object.

https://www.ranorex.com/Documentation/R ... ueText.htm

Sample:

Code: Select all

Dim varName As String = buttonInfo.FindAdapter(Of Button)().Element.GetAttributeValueText("Name")
Cheers,
Ned

Re: Need to retrieve List attribute of Live Elements (JavaList)

Posted: Mon Jun 04, 2018 10:17 pm
by subrata1
Thank you Ned...
It works when I have the following code.....

Dim ccyPairName As String = thisList.Items(i).Element.GetAttributeValueText("Name")