Chaining the capture from the output of running a Hurl file as input for another Hurl file #3455
-
I want to use "json paths" from a Hurl script file (
The ideal solution for me would be like bellow.
Then export
If
then I could pass
Do you have any idea if something like this (or similar) can be done? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What can be done with Hurl current version is using With this file:
We can run it with $ hurl --json file1.hurl --output file1.json
$ # Get the userId value and the Id
$ USER_ID=$(cat file1.json | jq '.entries[0].captures[0].value')
$ ID=$(cat file1.json | jq '.entries[0].captures[1].value')
$ hurl --variable "userId=${USER_ID}" --variable "id=${ID}" file2.hurl |
Beta Was this translation helpful? Give feedback.
Hi @OctavianHome
What can be done with Hurl current version is using
--json
: this way we have a structured output of the response and we can extract "easily" captured value.With this file:
We can run it with
--json
: