Micro Focus QTP (UFT) Forums
Javatree Problem - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Javatree Problem (/Thread-Javatree-Problem)



Javatree Problem - Omkar87 - 02-28-2012

Hi,
I am working on PLM Automation Teamcenter. I need your help for the following problem

I want to select or expand the nodes from javatree :
Code:
Set objSearchTree =  JavaWindow("MyWorkListWindow").JavaTree("MyWorkListTree")
objSearchTree.Select sNodeName  ' To select node sNodeName  
objSearchTree.Expand sNodeName   'To expand node sNodeName

The above code fails to select and expand,because passing nodename doesnt work.
It works well if indexes are used e.g #0:#0 but it wont be feasible.
Can you please suggest alternative methods.

Thanks in advance.


RE: Javatree Problem - inborntester - 02-29-2012

Can you try below

Code:
RegisterUserFunc "JavaTree","Expand","Expand"

Function Expand(Object, nodeouter)
For i=1 To (Object.GetItemsCount) step 1
    nodeinner=Object.GetItem(i)
    If nodeouter = nodeinner Then
        Object.Expand(i)
    End If    
Next
End Function

JavaWindow("MyWorkListWindow").JavaTree("MyWorkListTree").Expand(nodename)






RE: Javatree Problem - sshukla12 - 03-02-2012

Hi,

Could you please try this:
Code:
JavaWindow("Oracle Applications -").JavaInternalFrame("N").JavaList("0").Activate "+  Customers"
Regards,
Sankalp