メインコンテンツにスキップ

pause(一時停止)

指定した時間だけ実行を一時停止します。この命令を要素の表示を待つために使用することはお勧めしません。不安定なテスト結果を避けるために、waitForExistや他のwaitFor*コマンドのような命令を使用する方が良いでしょう。

使用法
browser.pause(milliseconds)
パラメータ
名前詳細
millisecondsnumberミリ秒単位の時間
pause.js
it('should pause the execution', async () => {
const starttime = new Date().getTime()
await browser.pause(3000)
const endtime = new Date().getTime()
console.log(endtime - starttime) // outputs: 3000
});

Welcome! How can I help?

WebdriverIO AI Copilot