- Print
- DarkLight
How do I add a time delay in a JS Step?
Article summary
Did you find this summary helpful?
Thank you for your feedback
When testing, you often want to wait a certain period of time before executing the next process.
In JavaScript, setTimeout()
is used to add a time delay.
However, since JS Step is executed asynchronously, the following process will happen before waiting for the current process to complete if you use setTimeout()
in a JS Step as it is.
To avoid this, JS Step should return a Promise
object so that Autify waits for the asynchronous process to finish.
Please refer to the following reference article for an example that uses async / await.
Was this article helpful?