Forum Discussion

c_hemant's avatar
c_hemant
New Contributor
14 years ago

Unable to recognize tree view element on Java based application

Hi,

    Need help in recognizing the tree view elements in javabased application.


Tried with the object browser tree view elements are not seen


 

Code :


function Test1()


{


  var javaw;


  var treeViewPanel;


  javaw = Sys["Process"]("javaw");


  javaw["SwingObject"]("LHN_Wizard_Dialog", "Management Groups, Clusters, and Volumes Wizard", -1, 1)["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane")["SwingObject"]("create_volume_wizard", "", 0)["SwingObject"]("JPanel", "", 0)["SwingObject"]("JPanel", "", 0)["SwingObject"]("LHNButtonBar", "", 0)["SwingObject"]("JButton", "Cancel", 3)["ClickButton"]();


  treeViewPanel = javaw["SwingObject"]("scc_Frame", "HP StorageWorks P4000 Centralized Management Console", 0)["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane")["SwingObject"]("MasterComponent", "", 0)["SwingObject"]("LHN_ScrollPane", "", 0)["SwingObject"]("JViewport", "", 0)["SwingObject"]("TreeViewPanel", "", 0);


  treeViewPanel["DblClick"](5, 40);


  treeViewPanel["Click"](6, 41);


  treeViewPanel["ClickR"](55, 52);


}



Above element are not capture by name everything is co-ordinate based.



Using demo version TC8



Regards,

hemant

1 Reply


  • Hi Hemant,





    TestComplete supports standard JTree controls from the Swing framework. If your tree control is inherited from a standard control, you can map your control to the standard JTree control using the Object Mapping feature. Please see the Project Properties - Object Mapping Options help topic to learn how to do this.





    Information explaining how TestComplete supports the JTree control can be found in the JTree Object help topic.





    If you are working with a control that is incompatible with a standard control, you can use its native methods and properties to work with individual nodes. Anyway, nodes of a tree control are not presented as individual objects in the Object Browser tree.