Skip to main content
added 5 characters in body
Source Link
alecxe
  • 11.4k
  • 11
  • 51
  • 107

It works and then stops the execution of subsequent code. So iI tried using Promises:

    this.driverWait = async function (explicitWaitMS) {
        // create a new promise inside of the async function
        let promise = new Promise((resolve, reject) => {
            setTimeout(() => resolve(true), explicitWaitMS) // resolve
        });

        // wait for the promise to resolve
        await promise;
    }

It works and then stops execution of subsequent code. So i tried Promises

    this.driverWait = async function (explicitWaitMS) {
        // create a new promise inside of the async function
        let promise = new Promise((resolve, reject) => {
            setTimeout(() => resolve(true), explicitWaitMS) // resolve
        });

        // wait for the promise to resolve
        await promise;
    }

It works and then stops the execution of subsequent code. So I tried using Promises:

this.driverWait = async function (explicitWaitMS) {
    // create a new promise inside of the async function
    let promise = new Promise((resolve, reject) => {
        setTimeout(() => resolve(true), explicitWaitMS) // resolve
    });

    // wait for the promise to resolve
    await promise;
}
Source Link
ColinWa
  • 101
  • 1

It works and then stops execution of subsequent code. So i tried Promises

    this.driverWait = async function (explicitWaitMS) {
        // create a new promise inside of the async function
        let promise = new Promise((resolve, reject) => {
            setTimeout(() => resolve(true), explicitWaitMS) // resolve
        });

        // wait for the promise to resolve
        await promise;
    }