mirror of
https://github.com/proxmoxer/docs.git
synced 2026-04-26 15:45:50 +03:00
[GH-ISSUE #46] Set environment variable #22
Labels
No labels
CodeDay
enhancement
pull-request
testmu
testmu
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/docs#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mikheillomidze on GitHub (Jan 21, 2022).
Original GitHub issue: https://github.com/hoppscotch/docs/issues/46
How can I set the environment variable in the tests script?
I was used to setting variables in postman like this:
Can I do something similar in hopscotch?
@rcdmk commented on GitHub (Jan 22, 2022):
Sadly, it seems to only be available in pre-request scripts:
@kahennig commented on GitHub (Feb 8, 2022):
Hi @mikheillomidze, yes, this was discussed here: #1425.
I am also eager to have this features. It's the last issue keeping me from migrating.
@mrteey commented on GitHub (Feb 24, 2022):
I have found a way: Add this to your test script not pre-request script
// Set an environment variablepw.env.set("token", pw.response.body.token);@lapo-luchini commented on GitHub (Feb 24, 2022):
Yes! Seems to be available in the most recent release, it wasn't working like this a few days ago.
@liyasthomas commented on GitHub (Feb 24, 2022):
Hoppscotch now allows setting environment variables from Test scripts, hence closing.
Doc: https://docs.hoppscotch.io/quickstart/tests#envsetvariablevalue
@kahennig commented on GitHub (Feb 24, 2022):
Thank you!!!
@MendDemo commented on GitHub (Jul 18, 2022):
I'm getting below issues

@kerembeyazit commented on GitHub (May 6, 2025):
Cannot find a variable called
pw.response.@Layhout commented on GitHub (Jun 19, 2025):
try it in test tab