Executes an arbitrary JavaScript code and returns its results. Depending on its mode
, Autopilot exposes different globals.
Javascript running in any of the available modes has access to ctx
, an Object with lots of useful properties, see https://github.com/automationcloud/autopilot/blob/master/packages/engine/src/main/runtime.ts.
The most frequently used properties of ctx
are:
ctx.script.getGlobal(key:string, optional:boolean=false)
/ctx.script.setGlobal(key:string, value:any)
, used for retrieving and assigning script globals, accessible with theValue.getGlobal
pipe and theGlobal.setGlobal
action;