maestro
maestro copied to clipboard
setTimeout in runScript
I am using runScript to execute a JS script but, I get the following error:
TypeError: TypeError: setTimeout is not a function, it is object. (scripts/fetch-invitation-url.js#11)}
Inside the script I am trying to sleep before performing a HTTP request (with retries), as I need to wait for an async process on my backend to finish executing.
Is setTimeout supported? Is there another wait for me to pause execution for a period of time?
+1
Bump, +1
What JS engine do you use? GraalJS or Rhino? Please also share your script, your flow, and in general, as much info as you can to make debugging easy for us.
I checked it. setTimeout works only with GraalJS.
appId: com.example.example
jsEngine: graaljs
---
- launchApp
- runScript:
file: script.js
setTimeout(() => {
console.log("Delayed for 1 second.");
}, 1000);
Solution: please use GraalJS instead of RhinoJS.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!