RUN
button to execute the script. The execution continues to the last line of the code and finishes when all asynchronous tasks are done (e.g.setTimeout
). The execution is successful if:return;
command to avoid errors while terminating the script.throw new Error('Something went wrong');
request
library doesn't provide an interface for working with async/await. One possible solution is wrapping request
call in Promise
objectawait
keyword. For convenience, we've added delay
function that will allow you to pause the script. This function is compatible with async/await:fs.promises
axios
tm
and it is available in the global scope. currentNode: nodeAPI
- the current Script node API project: nodeAPI
- the project node APIenv: envAPI
- the API for accessing the environment variablescookies: cookie[]
- a list of cookies used in the projectsystem: object
- an object, which contains the system's environment variablesparent: nodeAPI
- returns a parent node API and null for the project nodename: string
- the given node nametype: string
- the given node typepath: string
- the path to the given node starting with the project rootchildren: nodeAPI[]
- a list of child nodes APIsfindChild(name: string): nodeAPI
- searches for the child node using its name and returns null if the node doesn't existnext: nodeAPI
- the API of the next node in the group. If the given node is the last one, null is returnedprev: nodeAPI
- the API of the previous node in the group. If the given node is the first one, null is returnednextNodes: nodeAPI[]
- a list of all next nodes in the group. If the given node is the last one, an empty list is returnedprevNodes: nodeAPI[]
- a list of all previous nodes in the group. If the given node is the first one, an empty list is returnedvars: object
- the object that stores all static variables of the given nodedynamicVars: object
- the object that stores all dynamic variables of the given nodesetDynamicVar(name: string, value: any): void
- sets the name dynamic variable with a certain value for the given nodeRequestStep
node is more advanced.request: object
- the object that stores the node's request configurationresponse: object
- the object that stores the results of the last requestactive: string
- the active environment titlevars: object
- the object that stores the current environment variablesfindChild
method:faker
library and setting as the next node's dynamic variable UUI
. Once you've run the script, you can reference this variable in an URL, request body, etc.