Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20990

Trying to implement classes in my scripts.

$
0
0

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 is deprecated. We do not recommend using it when creating new tests."

But i understand that TC won't support ODT (Object driven testing) approach in future but can i still define my own class in one script (vbscript class) and access the methods of the class from any other script. All i am trying to do is the following:
'In unit A
Class car
Private a
public function setA(a1)
a = a1
Log.Message(" success")
End function
End class


'In Unit B
sub mysub()
dim objcar
Set objcar = new car
objcar.setA(5)
end sub

So far, i am unable to do the above because line 2 ( Set objcar = new car) doesn't work because class car is not accessible in Unit B but the code works fine if class and Sub mysub() are both present in 1 unit or script. Is there a way to implement classes like this in TC verision 10.60

Please share some inputs.
Thanks,
vik


Viewing all articles
Browse latest Browse all 20990

Trending Articles