代码之家  ›  专栏  ›  技术社区  ›  BlackGaff

在jmeter中使用转义字符时的java强制文本

  •  2
  • BlackGaff  · 技术社区  · 14 年前

    Declare the variable "ServerName" with the value 'serverNameValue'
    Declare the a variable "TestResultsFolder" with the value 'c:\results\${ServerName}'
    ... do samplers ...
    Have a simple data writer save result to "${TestResultsFolder}\file"
    

    不幸的是,数据写入程序正在保存到 c:\results\${ServerName} '代替' c:\results\serverNameValue '

    如果我在变量前加上一个有效的alpha字符,它就会起作用: ' c:\结果${ServerName} '收益率' c:\results\u服务器名值

    你有没有想过我该如何 c:\results\serverNameValue

    1 回复  |  直到 14 年前
        1
  •  1
  •   Benoit Courtine    14 年前

    “\”字符是否必须转义,以便明确表示您需要一个真正的“\”,而不是下一个字符的转义?

    c:\\results\\${ServerName} "