Hi guys,
could you please explain what args.executions
is referring too on the test
event callback?
I printed it and tried to find the documentation of its meaning specifically for that event I can’t figure it out.
}).on('test', function (error, args) {
console.log(args.executions.length);
}
is always returning 3 elements. What are these 3 elements?
I need to understand it because on this thread @udit suggested to use args.executions[0]
to retrieve the environment variables. I just want to understand why args.executions[0]
and not args.executions[1]
or args.executions[2]
for instance?
Below an example:
[
{
event: PostmanEvent { listen: 'test', script: [PostmanScript] },
script: PostmanScript {
id: '0b5f0147-b5ac-4489-8751-bafc6aac36f4',
type: 'text/javascript',
exec: [Array],
_lastExecutionId: '40c6e1b9-478c-4a97-95ed-e92fcb64a20a'
},
result: {
id: '40c6e1b9-478c-4a97-95ed-e92fcb64a20a',
target: 'test',
legacy: [Object],
cursor: [Object],
data: {},
cookies: [],
_variables: [PostmanVariableScope],
environment: [PostmanVariableScope],
collectionVariables: [PostmanVariableScope],
globals: [PostmanVariableScope],
request: [PostmanRequest],
return: {},
response: [PostmanResponse]
}
},
{
event: PostmanEvent { listen: 'test', script: [PostmanScript] },
script: PostmanScript {
id: '4325ec73-bdf0-4ada-af76-d86a003f6d61',
type: 'text/javascript',
exec: [Array],
_lastExecutionId: '332c1c2c-913a-442e-9e0f-f893fb548087'
},
result: {
id: '332c1c2c-913a-442e-9e0f-f893fb548087',
target: 'test',
legacy: [Object],
cursor: [Object],
data: {},
cookies: [],
_variables: [PostmanVariableScope],
environment: [PostmanVariableScope],
collectionVariables: [PostmanVariableScope],
globals: [PostmanVariableScope],
request: [PostmanRequest],
return: {},
response: [PostmanResponse]
}
},
{
event: PostmanEvent { listen: 'test', script: [PostmanScript] },
script: PostmanScript {
id: '9db33696-7fe1-4ca3-8010-dd927ebb2fbe',
type: 'text/javascript',
exec: [Array],
_lastExecutionId: 'c1bf9766-b91d-4898-825b-0d38661f4a54'
},
result: {
id: 'c1bf9766-b91d-4898-825b-0d38661f4a54',
target: 'test',
legacy: [Object],
cursor: [Object],
data: {},
cookies: [],
_variables: [PostmanVariableScope],
environment: [PostmanVariableScope],
collectionVariables: [PostmanVariableScope],
globals: [PostmanVariableScope],
request: [PostmanRequest],
return: [Object],
response: [PostmanResponse]
}
}
]
Thanks in advance
Aurélien