We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
There are a few ways.
1) Square bracket notation:
var method = "Message";
Log[method]("test");
2) https://support.smartbear.com/testcomplete/docs/reference/language/javascript/call-method.html:
Log.$call("Message", "test");
3) https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqobject/callmethod.html:
aqObject.CallMethod(Log, "Message", "test");
Additionally you can use eval function.
https://www.w3schools.com/jsref/jsref_eval.asp
Two examples of use of both eval and the other method mentioned before:
eval("Log.Checkpoint('Hello Logger!')");
Log["Checkpoint"]("Hello Logger!");