Forum Discussion

DavidE's avatar
DavidE
Contributor
6 years ago
Solved

Log Message and Code Expressions

I am attempting to post a log message in a keyword test that has both static text as well as a variable.  It seemed simple enough.   I figured from within the Log Message, I would choose "Code Expr...
  • tristaanogre's avatar
    6 years ago

    It's possible that the syntax for concatenation of strings that you have printed is not proper syntax for the code language selected for your test project.  I believe VBScript uses a different concatenation syntax.

    The other possibility has to do with the fact that script languages are not strongly typed.  So, if the variable is an object and you're trying to concatenate it as a string, behavior is unpredictable.  Or if it's a number. Or something like that.  Double check the variable data type.  If it's not set to string you might want to explicitly convert

     

    "Results: " + aqConvert.VarToStr(KeywordTests.TestNameVariables.VariableName)