Chaining the capture from the output of running a Hurl file as input for another Hurl file #3455
Unanswered
OctavianHome
asked this question in
Q&A
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.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to use "json paths" from a Hurl script file (
file-001.hurl
) as input for a subsequent Hurl script file (file-002.hurl
).I know that I could use both Hurl script files (
file-001.hurl
andfile-002.hurl
) in the same Hurl file but this is not an option for me.One potential solution (which is not quite convenient for me) would be to save the output of
file-001.hurl
to afile-output-001.json
file, update that file tofile-output-001.env
file and then pass it as--variables-file
to thefile-002.hurl
.This is not convenient for me because:
file-output-001.json
tofile-output-001.env
accepted by Hurlfile-output-001.json
content, regardless of what input (json path) I needThe ideal solution for me would be like bellow.
The
file-001.hurl
content:Then export
userid
andid
using some cli flag (--export-variables
) to anoutput-001.env
file with this content:If
file-002.hurl
has this content:then I could pass
output-001.env
as input file forfile-002.hurl
like this:Do you have any idea if something like this (or similar) can be done?
Beta Was this translation helpful? Give feedback.
All reactions