【问题标题】:Get values with regex in JMeter Regular Expression Extractor在 JMeter 正则表达式提取器中使用正则表达式获取值
【发布时间】:2019-04-02 06:47:11
【问题描述】:

我尝试在JMeter 中的引号之间获取值,但我在myvar_1_g0 命名变量中取回整个字符串而不是值。测试人员:https://regex101.com/r/aId5jo/2

示例文本:LoadXMLString("Response", window.atob("SGVsbG8="));

正则表达式:LoadXMLString\("Response", window\.atob\(".*"\)\);

【问题讨论】:

  • 使用LoadXMLString\("Response", window\.atob\("([^"]*)"\)\); (demo) 并通过myvar_1_g1 获取。使用$1$作为模板
  • @WiktorStribiżew:谢谢,解决了。

标签: regex jmeter


【解决方案1】:

您可以像这样使用捕获组:

LoadXMLString\("Response", window\.atob\("([^"]*)"\)\);
                                          ^^^^^^^  

请参阅regex demo

要获取捕获的值,请使用myvar_1_g1$1$ 值作为模板。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多