06-20-2011, 04:30 PM
I think you should use the GetROProperty and assign the get value to a string which will be used in another part. I will try but not sure if it will work, you'll need to adapt the code a little, I does not worked with java applications, and I don't know which are the objects' properties and their values. See next:
- I'm not sure if GetColumnValue is the right method, maybe you should use: GetItem, to get you value for the specified node, or GetRoProperty.
GetColumnValue returns the text from the specified column in the specified node in the tree.
GetItem returns the value of the node specified by the index.
I don't realy understand what do you mean by saying: to drop it in another tree structure. Maybe you mean to check if it exists under another tree?!
Code:
Dim obj_Property1, obj_Property, obj_Property2, obj_Value1, obj_Value2
Set obj_Value1 = JavaWindow("XXX_1").JavaTree("obj_JavaTree1").(GetColumnValue)
Set obj_Value2 = JavaWindow("XXX_1").JavaTree("obj_JavaTree1").(GetColumnValue)
GetColumnValue returns the text from the specified column in the specified node in the tree.
GetItem returns the value of the node specified by the index.
Code:
Public Function WebElement (obj_Property1, obj_Property2, obj_Value1, obj_Value2)
Set obj_JavaTree2 = Description.Create
obj_JavaTree2 ("Class Name").value = "WebElement"
obj_JavaTree2 (obj_Property1).value = obj_Value1
obj_JavaTree2 (obj_Property2).value =obj_Value2
If JavaWindow("XXX_2").JavaTree("obj_JavaTree2").Exist Then
Reporter.ReportEvent micPass, "The object found", "The java tree object is found under the second Java Window"
Else
Reporter.ReportEvent micFail, "The object not found", "The java tree object with " & obj_Property1 & "=" & obj_Value1 & " and " & obj_Property2 & "=" & obj_Value2 " is missing from the second java Window."
End Function
I don't realy understand what do you mean by saying: to drop it in another tree structure. Maybe you mean to check if it exists under another tree?!