07-25-2018, 06:00 PM
I have this JaVaTree and i want to access the nodes inside this Javatree using names like "17026-3 Program control unit" instead of indexes. How should i do that ?
I am trying the below code but it does not work :
Dim itemsCount
Dim ProgramName
Dim objItem
ProgramName = "17026-3 Program control unit"
itemsCount = CInt(WpfWindow("Tech Tool").JavaWindow("Program_ECU").JavaTree("Program_Control_Unit").GetROProperty("items count"))
Set objItem = WpfWindow("Tech Tool").JavaWindow("Program_ECU").JavaTree("Program_Control_Unit").Object
For i = 0 To itemsCount
If Trim(CStr(ProgramName)) = Trim(CStr(objItem.getItem(i))) Then
objItem.Select(i)
msgbox "Success"
End If
Next
I get this error :
Object doesn't support this property or method: 'getItem'
Line (10): "If Trim(CStr(ProgramName)) = Trim(CStr(objItem.getItem(i))) Then
PLEASE HELP!
I am trying the below code but it does not work :
Dim itemsCount
Dim ProgramName
Dim objItem
ProgramName = "17026-3 Program control unit"
itemsCount = CInt(WpfWindow("Tech Tool").JavaWindow("Program_ECU").JavaTree("Program_Control_Unit").GetROProperty("items count"))
Set objItem = WpfWindow("Tech Tool").JavaWindow("Program_ECU").JavaTree("Program_Control_Unit").Object
For i = 0 To itemsCount
If Trim(CStr(ProgramName)) = Trim(CStr(objItem.getItem(i))) Then
objItem.Select(i)
msgbox "Success"
End If
Next
I get this error :
Object doesn't support this property or method: 'getItem'
Line (10): "If Trim(CStr(ProgramName)) = Trim(CStr(objItem.getItem(i))) Then
PLEASE HELP!