Forum Discussion

ANW's avatar
ANW
Contributor
14 years ago

Calling WinFormsObjects question

I have yet another newbie question regarding WinFormsObjects.



When I tested Delphi applications, I never used the VCLObejct('') part of an object name, and wanted to do the same with WinFormsObjects, as the full path name quickly becomes very big and cumbersome.



Anyways, using the recorder to test some things in my new apps, I could see that the recorder sometimes discarded the WinFormsObject part, and sometimes not, and I can't really figure out why.



Here is an example of a method call that works:



Sys.Process('VictorTEST').CreateCustomer.tsCreatedCustomer.tabItem1.gbCompany.clientPicker1.WinFormsObject('comboBox1').ClickItem



Now i thought, I could just remove the WinFormsObject around comboBox1, but then I get a runtime error (ClickItem is then an unknown method). Why do I need it for the comboBox1 and not the other objects??

2 Replies


  • Hi Anders,





    I suppose you have the "Use short names when possible" option described in the "Engines - General Options" (http://www.automatedqa.com/support/viewarticle/11338/) help topic enabled. If so, it means that using the short name can cause possible naming conflicts in this particular case and therefore TestComplete has to use the WinFormsObject method to address the object explicitly. If you want to use short names for all objects and even remove some unnecessary objects from the hierarchy, I recommend that you use the Name Mapping feature. Please see the "Name Mapping - Overview" help topic (http://www.automatedqa.com/support/viewarticle/11327/) for more information.


  • ANW's avatar
    ANW
    Contributor
    Hey Allen



    Thanks for the explanation. I guess that means it is a bad naming convention used by the developers. I will need to kick some behind then ;)