Forum Discussion

vik33's avatar
vik33
Occasional Contributor
10 years ago

Trying to implement classes in my scripts.

I am trying to implement classes in my scripts but unable to do so. I see the follwing line on every page for testcomplete documentation for classes. "The object-driven testing (ODT) functionality i...
  • vik33's avatar
    vik33
    9 years ago

    The solution is:

     

    In every script (unit) just make a function that returns a reference to that class and call that function from any other unit to make use of that class.

     

    Unit A

    Class A

     

    End class

    Function GetClassARef(obj A)

    objRef = new Class A

    GetClassARef = objRef

    End function

     

    Call above function from any other script.

    Thanks.