Forum Discussion

Manfred_F's avatar
Manfred_F
Regular Contributor
10 years ago

create wrapper objects in script extensions

Using Scripting, I can create objects using the <class> keyword in vbs and a Routine in the same module, which instantiates an object for it.

Can I do a similar Thing in a script Extension? Can the class' properties and methods be seen in Code Completion?



Thanks,

Manfred

4 Replies

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Manfred, Script Extensions are not instantiable Classes, they are a simpler means to extend Test complete than using Custom Plug-Ins.



    To quote the Script Extension documentation:




    "Script extensions are a simple and powerful technology for creating TestComplete plug-ins"


     


    Script Extensions are embedded into Test Complete on startup and can be viewed in the same way as Test Complete objects such as aqString.


     


    Regards,


    Phil Baird

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    The Script Extension would be, itself, your class.  All your properties and methods would be the properties and methods for the Script Extension.  So, short answer, yes.. but not in the same way, necessarily, that you would create classes in a script unit.
  • Manfred_F's avatar
    Manfred_F
    Regular Contributor
    I've found a WORKAROUND for this: object oriented work is more fun..



    In my class' code file, I added the class' members as empty prototypes at the end (see attachment, DialogClass). This makes them appear in code completion (screenshot use Dialog class), when the XML description is correct (see attaachment).

    After selecting the desired member, ist path has to be replaced by the object Name (screenshot call class member).



    Here You are.



    Regards,

    Manfred
  • Manfred_F's avatar
    Manfred_F
    Regular Contributor
    OK, so I have to go the procedural way, here.

    Thank You for answering quickly.



    Manfred