Skip to main content

pause

Overview

Use the pause command to halt the execution of the test for a specified period of time.

warning

It is not recommended to use this command for waiting for an element to appear. To avoid false test results, it's better to use commands like waitForExist or other waitFor* commands.

Usage

await browser.pause(milliseconds);

Command Parameters

NameTypeDescription
millisecondsNumberTime in milliseconds.

Usage Examples

it("should pause the execution", async ({ browser }) => {
const starttime = new Date().getTime();
await browser.pause(3000);
const endtime = new Date().getTime();

console.log(endtime - starttime); // outputs: 3000
});

References

We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.