How do I add a time delay in a JS Step?
  • 29 Aug 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light

How do I add a time delay in a JS Step?

  • Dark
    Light

Article Summary

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?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.