Forum Discussion

odedma's avatar
odedma
Contributor
13 years ago

User Methods

Hello, I would like to add a user method to an object.

In QTP there is a command called "RegisterUserFunc" that allows me to add a user method that will be available for a specific type of objects.



The desired use is something like this: browse.MainTable.MyCustomMethod(Params).



Does TestComplete supports something like this or only built in functions are available?



Thanks. 

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 2 rankChampion Level 2
    Hi,



    Just create the MyCustomMethod() function and pass browse.MainTable to it as a parameter.

    Regardless of the type of call (browse.MainTable.MyCustomMethod(Params) or MyCustomMethod(browse.MainTable, Params)) the access to the MainTable internals will be the same.

    You may consider Connected Application approach (http://support.smartbear.com/viewarticle/27489/) if you have access to the sources, but this is quite a different type of testing.