简体   繁体   中英

How to retrieve Jmeter response and use on Http request

Example the request I used is "https://test.com/devices/entities/devices/v1?ids=abc"

and this is my response:

{ "meta": { "query_time": 0.003134801, "powered_by": "device-api", "trace_id": "Test" }, "resources": [{ "device_id": "ABCD-1234", "hostname": "Test-Machine1" }] }

My question here is how can I extract the value of device_id, hostname so I could use that on my Http request every invoke. Hoping for your response. Thank you so much.

Expected Result: I want to retrieve the device_id, hostname and used that on my Http request every invocation

enter image description here

You can do it using JSON Extractor , the relevant JSON Path Expressions would be $..hostname and $..device_id correspondingly

Demo:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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