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

如何在jmeter中创建正则表达式提取器

  •  -1
  • user6248190  · 技术社区  · 6 年前

    我正试图使用regex表达式提取器从jmeter中的post提取位置。标题如下

    HTTP/1.1 201 Created
    Transfer-Encoding: chunked
    groopId: ID-99-Inc-07-12300-2650126876118-1-236
    User-Agent: RestClient-Tool
    Date: Thu, 14 Feb 2019 13:57:23 GMT
    Location: v2/TestData/12sff-13343e-dff3444455
    Content-Type: text/plain; charset=UTF-8
    

    我需要 Location: v2/TestData/12sff-13343e-dff3444455 .

    enter image description here

    我正在挣扎,因为我不太确定如何创建我需要的正则表达式。

    1 回复  |  直到 6 年前
        1
  •  2
  •   Dmitri T    6 年前
    1. 添加 Regular Expression Extractor 作为返回头以上的请求的子级
    2. 配置如下:

      • 适用于:取决于 Location 标题来自
      • 要检查的字段: Response Headers
      • 正则表达式: Location: (.*)
      • 模板: $1$

        enter image description here

    3. 就这样,您应该能够访问提取的值 ${location} 如果需要。

    参考文献: