--- title: "Adding Time Delay in JS Steps in Autify: Step-by-Step Guide | Autify" slug: "how-to-wait-in-js-step" description: "Discover How to Incorporate Time Delays in JS Steps for Precise Automation Testing in Autify. Begin Your 14-Day Trial Now!" updated: 2022-08-29T10:13:34Z published: 2022-08-29T10:13:34Z canonical: "help.autify.com/how-to-wait-in-js-step" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.autify.com/llms.txt > Use this file to discover all available pages before exploring further. # How do I add a time delay in a JS Step? 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. - [Delay (with await)](https://javascript-snippets.autify.com/snippets/others/delay/)