简体   繁体   English

Jmeter json路径提取器 - 如何删除字符串

[英]Jmeter json path extractor - How to Remove String

在此输入图像描述

I have a problema with the next point: 我对下一点有疑问:

{

    "id":"3be62315-cd79-4e13-9536-0ee496e72184;1.0",
    "objectType":"DOCUMENT",
    "metadata":
    {
        "gdoc:filePath":null,
        "gdoc:filename":"blankOdt.odt",
        "gdoc:machineId":null
    },
    "checkedout":false,
    "immutable":false,
    "latestVersion":false,
    "majorVersion":false,
    "latestMajorVersion":false,
    "contentStreamLength":0
}

I need recovery 3be62315-cd79-4e13-9536-0ee496e72184 and not "3be62315-cd79-4e13-9536-0ee496e72184;1.0", 我需要恢复3be62315-cd79-4e13-9536-0ee496e72184而不是“3be62315-cd79-4e13-9536-0ee496e72184; 1.0”,

I cant remove ";1.0" of the expression. 我不能删除表达式的“; 1.0”。

You can do it this way: 你可以这样做:

  • Suppose your JSON Path PostProcessor uses variable id for $..id 假设您的JSON Path PostProcessor为$ .. id使用变量id

在此输入图像描述 - Add a regex post processor after the JSON Post Processor and make it act on the variable - 在JSON后处理器之后添加一个正则表达式后处理器,并使其对变量起作用

在此输入图像描述

Then use ${id_part1} 然后使用$ {id_part1}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM