test specific variables #590
Unanswered
amlwwalker
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Hi @amlwwalker , I'm not sure to well understand the use case, can you provides us a full example please? Is it to use this variable in a user executor ? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hello! example:
- name: First_test
vars:
userID:
from: result.body
regex: '"id":\s*([0-9]+)'
# or simpler way to change a variable value
# or why I'm not able to reuse it here too?
script: |
echo " {{ .userID }}
-name: Test_second
- name: Log_ userID
steps:
- type: exec
command: /bin/bash
script: |
echo " {{ .First_test.userID }}
# and why all ouput have this red characters because colors not interpreted correctly in ubntu?
Nov 6 22:14:04.843�[37m [DEBU] [Test API Endpoints] [Log_JWT] �[0mRunning testcase with variable Test_Login.__type__: Result
Nov 6 22:14:04.843�[37m [DEBU] [Test API Endpoints] [Log_JWT] �[0m |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am aware I can set variables at the top of the yaml config file however is it possible to set a variable within a specific test that can then be used in that test?
For instance:
in this case - I would like to have
testt1
as a variable so I can change its name in one location - however I want it scoped to this test. Is that possible?Beta Was this translation helpful? Give feedback.
All reactions