Forum Discussion

vijay6105's avatar
vijay6105
Contributor
14 years ago

Testcomplete 8.5 can't read objects defined in TestComplete 6.5

set GetObjectFromtheStr = Sys.Process("Virtual FlexPendant").VFPForm.WinFormsObject("MdiClient", "").TafUI.ClientViewPanel.TPSControl.WinFormsObject("Panel", "").ConPanLV



I want to get the object in GetObjectFromtheStr . 

The above line is recorded in tetcomplete 6.5, working fine using Testcomplete 6.5 but I'm not able to get the object GetObjectFromtheStr using Testcomplete 8.5

I have selected both options in tools-->options-->namemapping --> both automatically update and map objects

how to map rcorded objects in testcomplete 6.5 to tstcomplete 8.5 

8 Replies

  • Hi,



    Name Mapping settings do nothing here since your code doesn't use Name Mapping. Check the problematic object's name in the Object Browser to find out how it differs from the name used in your script.
  • Hi,



    Yes, there is no problem with namemapping. the problamtic object is WinFormsObject("Panel", ""). I'm getting log message unable to find panel object. I suppose there is a problem with WinFormsObject("Panel", "") object but the syntax is same in the object browser.



    In the object browser full name of the object is below: 



    Sys.Process("Virtual FlexPendant").WinFormsObject("VFPForm").WinFormsObject("MdiClient", "").WinFormsObject("TafUI").WinFormsObject("ClientViewPanel").WinFormsObject("TpsControl").WinFormsObject("Panel", "").WinFormsObject("ConPanLV")
  • Hi,



    When you get the 'unable to find object' error, what is posted in its 'Additional info' section?
  • Hi



    Additional info says  ' The object with specified attributes does not exist'.  

    I tried to record object without namemapping when I playback it gives unable to find object. In the object browser the full name of the object and recorded object is same but still when I playback it gives error message unable to find object. Eg:




    Set panel = Sys.Process("Virtual FlexPendant").WinFormsObject("VFPForm").WinFormsObject("MdiClient", "").WinFormsObject("TafUI").WinFormsObject("ClientViewPanel").WinFormsObject("TpsControl").WinFormsObject("ConPanCfg").WinFormsObject("TpsControl").WinFormsObject("Panel", "", 3)


     


    panel.WinFormsObject("RadioButton", "Load parameters if no duplicates").ClickButton


    Error log ' unable to find object WinFormsObject("Panel", "", 3) and Additional info is same as above 


  • Hi,



    Most probably, there's no 'Panel' object whose index is equal to 3. Make sure that you use the correct index or omit it if there're no similar objects on the same hyerarchy level. If there're several 'Panel' objects, use Find to obtain the button you need to click. Start searching from WinFormsObject("TpsControl") to omit the panel.
  • Hi,



    I found one problem, in the object browser there are three child objects with name WinFormsObject("TpsControl") whose indexes are 1, 2 and 3 respectively. TestComplete reads objects from object browser in bottom up fashion so it is taking object with index 1 but i need objct with index 3. Top most window in the application has index 3 so I need to work on index 3 object. 



    Problem is index keeps changing during run so I don't know the exact index to use it in the object as parameter.



    How to make testcomplete read object from the object browser with index 3 or top most index ????. 
  • Hi,



    Using indexes is not reliable in any case. Try using Find as I suggested in my previous post.
  • Hi,





    Is there any option in TestComplete 8.5 to read objects with same name from the object browser in top to down while running the script.



    Actually in TestComplete 6.5 it automatically reads objects with same name from the object browser in top to down while running.



    Problem is I want to read object( ' Obj .WinFormsObject("TpsControl") ' ) but there are many child objects of  Obj with same name WinFormsObject("TpsControl") so it is reading WinFormsObject("TpsControl") from the bottom but I want WinFormsObject("TpsControl") object from the top.



    I can't use index for the WinFormsObject("TpsControl") because it is not constant. Even I can't use Find method as its name, wnd caption and some other properties are mostly same.  Also this object Obj .WinFormsObject("TpsControl") is referred in many places in the code and there is a common method to get this object called 'GetObjectFromStr'. now each time is called from different window of the applicatioon so there are different properties for finding the object which is to be included in that common method.



    But my problem would be solved if TestComplete 8.5 can read objects with same name from top to down from object broser while running like as it is doing in TestComplete 6.5