Search code examples
javascripttry-catchelectronnightmare

Nightmare - I can't catch which line of code gives me an error with two or more .wait()


I using Nightmare + Electron. I can't catch which line of code gives me an error with two or more .wait(). Here is example of my code:

try {
    await this.nightmare
        .goto(userUrl)
        .wait('.sales-modal .private-flex .uiDropdown__buttonCaret')
        .click('.sales-modal .private-flex .uiDropdown__buttonCaret')
        .wait('.table-row')
        .click('.sales-content-table .table-row:first-child .sales-content- 
        table-actions button');
} catch (err) {
    console.log(err);
}

No meter which .wait() are wrong it always gives me this:

Error: .wait() timed out after 30000msec
at Timeout._onTimeout (C:\OSPanel\domains\avg-nightmare\node_modules\nightmare\lib\actions.js:453:10)
at ontimeout (timers.js:482:11)
at tryOnTimeout (timers.js:317:5)
at Timer.listOnTimeout (timers.js:277:5)

Can anyone help me with this?


Solution

  • Problem was solved by updating Nightmare to the latest version. Thanks.