cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to add methods as 'Test Items' when methods actually are actually written inside the class

SOLVED
Highlighted
Contributor

Unable to add methods as 'Test Items' when methods actually are actually written inside the class

This is important to my project

All my methods are written inside class

This actually creates a problem as I am not able to call methods on project 'Test Items' page

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Unable to add methods as 'Test Items' when methods actually are actually written inside the clas

These are scripts, not application code.  While classes are useful in organizing the objects and such, in order for TestComplete to execute them, they need to be made available as a method or function external to the class.  This can be done with a simple wrapper like

 

function runMyMethod(){
    var myObject = new myClass();
    myObject.Method();
}

Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
1 REPLY 1
Community Hero

Re: Unable to add methods as 'Test Items' when methods actually are actually written inside the clas

These are scripts, not application code.  While classes are useful in organizing the objects and such, in order for TestComplete to execute them, they need to be made available as a method or function external to the class.  This can be done with a simple wrapper like

 

function runMyMethod(){
    var myObject = new myClass();
    myObject.Method();
}

Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
New Here?
Join us and watch the welcome video:
Top Kudoed Authors