Sure, the JS script just needs to use the variables as usual. Following
a full example for the record.
Given a JS script called "set_global_var.js" that sets a global variable:
ScriptVars.setGlobalVar(name, value)
(ScriptVars package omitted for brevity.)
The Zest script then passes the "name" and "value" as parameters when
invoking the script, e.g.:
{
"title": "ZestScript",
"type": "StandAlone",
"parameters": {
"tokenStart": "{{",
"tokenEnd": "}}",
"tokens": {},
"elementType": "ZestVariables"
},
"statements": [
{
"string": "NameGlobalVar",
"variableName": "myZestVar",
"index": 1,
"enabled": true,
"elementType": "ZestAssignString"
},
{
"string": "ValueGlobalVar",
"variableName": "myZestValue",
"index": 2,
"enabled": true,
"elementType": "ZestAssignString"
},
{
"variableName": "",
"script": "/path/to/set_global_var.js",
"parameters": [
[
"name",
"{{myZestVar}}"
],
[
"value",
"{{myZestValue}}"
]
],
"index": 3,
"enabled": true,
"elementType": "ZestActionInvoke"
}
],
"authentication": [],
"index": 0,
"enabled": true,
"elementType": "ZestScript"
}
(Note that the above script path needs to be adjusted.)
Best regards.