francisd84
5 years agoContributor
Javascript template litterals don't seems to work
According to documentation, JavaScript language in TC is supporting the template litterals to format strings
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqstring/format.html
But even the example shown in the documentation doesn't seems to work.
To ensure that I was not in JScript, I created a new project with JavaScript language selected.
Then, I created a script function with:
var str = "test";
Log.Message("This is a ${str}");
The output is: This is a ${str}
TC version: 14.40.1658
Someone can confirm?
Thanks!
Nevermind... I found the problem: need to replace " by ` for litterals to be taken into account.
So: Log.Message(`This is a ${str}`) is working.
Thanks a lot!