Forum Discussion
Philip_Baird
11 years agoCommunity Expert
Hi Howie, I am assuming from your post that you have created a Script Extension "Person".
Script Extensions do not create instantiable Classes, you are correct in your observation that they create a singleton Object, much the same as, say, the built in Test Complete aqString Object.
The only way to acheive want you want from a Script Extension is to have the following in the Person Script Extension
var Person = function( age ) {
this.Age = age;
}
function newPerson( age ) {
return new Person( age );
}
which can then be called such as
function testNewPerson() {
var a = Person.newPerson( 10 );
var b = Person.newPerson( 3 );
Log.Message( a.Age + ", " + b.Age );
}
Regards,
Phil Baird
Related Content
Recent Discussions
- 15 hours agotramuntana
- 3 days agoSlickRick