Forum Discussion
I would go ahead and contact Support for this issue. Here's the link:
First parameter of Runner.CallMethod has to be a string of the format unit_name.method_name. So, if you have a script method called "Blah" in unit "MyUnit" with two parameters, you would call
Runner.CallMethod('MyUnit.Blah', 'value1', 'value2')
So, you need to make sure that, whatever that first value is of _impl_verificationManager returns a string in the desired format.
While Runner.CallMethod is noted as obsolete, I'm not sure that it's going away any time soon.
If, however, you are using JavaScript, you could kind of play with the same idea but using classes. Say, for example, you have a class like below. Note that it's best to define the class in a single code unit:
class foo{ constructor(){ this.bar = 'This is my bar'; }
writeBar(){
Log.Message(this.bar);
} } module.exports = foo;If you want to call the "writeBar" method in some other unit, you can do it something like this.
function runClassMethod(className, methodName){ var localClass = require(className); var localObject = new localClass(); localObject[methodName](); }
function test(){
runClassMethod('foo', 'writeBar');
}Now, this is just a demonstration of the concept. Obviously, there's more complexity that would need to be applied to do what you want (different parameters, reading values in from spreadsheet, etc), but this is a legitimate replacement for Runner.CallMethod.
By the way CallMethod is obsolete - https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/script/runner/callmethod.html
What is your specific task you are trying to solve?
Why you are not using a direct call of the required function?
Related Content
Recent Discussions
- 43 minutes ago
- 12 hours ago