Forum Discussion

vish_borade's avatar
vish_borade
Occasional Contributor
12 years ago

Unable to access TreeView from JavaScript

I have just started using TestComplete.

And I am testing a complex application developed in .NET.

I don't have any access to the app code or any way to communicate 

with developer.

I am trying to access a tree view in the application through javascript but

I haven't been able to achieve it for last few hours.

Object explorer shows following path to the node :-



Sys.Process("ETIAdmin").WinFormsObject("AdmMainForm").WinFormsObject("_admMainPanel").WinFormsObject("_contextPanel").WinFormsObject("_cmdsPanel").WinFormsObject("_cmdsTreeView")



I can successfully access the object chain till '
_cmdsPanel' but when i try to access "_cmdsTreeView" it gives 'unable to find object' error.



Object explorer shows the 
WinFormsObject("_cmdsTreeView") class type as Systems.Windows.Forms.TreeView.



Any clues or pointers will be really helpful.















  • vish_borade's avatar
    vish_borade
    Occasional Contributor
    I have also attached test app and object brawser screen shots above.
  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Vish, have you investigated Name Mapping in Test Complete?



    If not, I would suggest you start there as a way of accesing your application objects.



    Regards,

    Phil Baird
  • vish_borade's avatar
    vish_borade
    Occasional Contributor
    Thanks Phil for the reply.

    Yes, I had gone thro' all possible means to access TreeView node of my application,

    including trying to access tree by it's class name and other properties. Or even accessing it as a child of it's parent using 'FindChild' . I get an object in above cases but when I try to invoke TreeView methods on it it says "property not  supported". 



    I didn't give it a shot to 'Name Mapping' though as anyway i wasn't trying to access TreeView using object chaining in one single statement. I am retrieving every single WinFormsObject in a separate call. And 'name mapping', i thought, is simply a way to assign a short and simple name to longer object chains or names.  

    Also I want my javascripts to run on various TestComplete environments without having to perform 'name mapping' in each case, 'name mapping' won't work in any case being aside. 

    As said before i  am being able to access object chain, using individual calls, till i reach parent object of TreeView. But accessing Treeview simply fails.

    -Thanks 
     
  • vish_borade's avatar
    vish_borade
    Occasional Contributor
    Problem resolved. I think it worked after i added System.Window.Forms.TreeView class to object mapping of 'Win 32 controls' > TreeView