Forum Discussion

mgroen's avatar
mgroen
Frequent Contributor
11 years ago

correct syntax for displaying text and variable value

I am running keyword test,
during this test I want to display following in the "Str" section of the delay functionality (which displays the actions during runtime).

"variable value is" [variable value]

I have been able to just to display the variable value, but I want to little string "variable value is", to be added but I can't get it to work...

Any help from anybody?

  • Hi Mathijs,


     


    Make sure that you are using the Code Expression mode to specify a string along with a variable like on this image:


  • VBscript? I think you need an ampersand between your string and variable name:



    "variable value is " & [variable value]
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Mathijs,


     


    Make sure that you are using the Code Expression mode to specify a string along with a variable like on this image:


  • mgroen's avatar
    mgroen
    Frequent Contributor
    @Joe,



    unfortunately,

    "variable value is " & [variable value] does not work :(



    see attached screenshot
  • mgroen's avatar
    mgroen
    Frequent Contributor
    @Tanya,



    thank you, the "+" in the syntax did it!



    :)
  • mgroen's avatar
    mgroen
    Frequent Contributor
    @Marsha,



    thank you for your tip. It worked (also needed to convert the int to a str, using aqConvert). :)