Smart Wait Function
This article shows you how to enable and use the Smart Wait function in Katalon Studio.
The Smart Wait function tackles the timing issue of automated web testing by automatically waiting for all front-end processes of a page to complete before taking further test steps. This function helps reduce the risk of test failures caused when the page has not fully loaded.
Katalon Studio allows you to use the Smart Wait function as a browser extension.
Download the Smart Wait sample project from our GitHub repository: Smart Wait sample tests.
- From Katalon Studio 10.0.0, Smart Wait no longer requires an unpacked extension in browsers that support BiDi (Bidirectional communication), including Chrome, Edge, Firefox, and headless browsers.
For environments that do not support BiDi (such as Safari, remote browsers, or TestCloud environments), Smart Wait still requires an unpacked extension to operate correctly.
To disable BiDi for environments that don't support it, set
"webSocketUrl": false
in the desired capabilities.
Enable Smart Wait in Katalon Studio
Temporarily turn off Smart Wait
You can use the enableSmartWait
and disableSmartWait
keywords to enable/disable Smart Wait during the test temporarily.
enableSmartWait
or disableSmartWait
keywords to enable/disable Smart Wait on your target elements.In the following example, we first use the disableSmartWait
keyword to disable Smart Wait at the beginning of the test temporarily.
enableSmartWait
keyword to enable Smart Wait when setting text on the Username
object. Smart Wait is enabled until the disableSmartWait
keyword is applied.
WebUI.disableSmartWait()
WebUI.openBrowser('')
WebUI.navigateToUrl('https://store.katalon.com/')
WebUI.maximizeWindow()
WebUI.click(findTestObject('signin-link'))
WebUI.enableSmartWait()
WebUI.setText(findTestObject('username'), 'demo@katalon.com')
WebUI.setEncryptedText(findTestObject('password'),'3zBGMH+v8QQXwX1AbEAx2g==')
WebUI.click(findTestObject('signin-button'))
WebUI.click(findTestObject('menu-dropdown'))
WebUI.click(findTestObject('dashboard-item'))
WebUI.click(findTestObject('plugins-item'))
WebUI.disableSmartWait()
WebUI.closeBrowser()
Workaround for remote execution
The following is a workaround for applying Smart Wait extension for remote execution.
To apply Smart Wait for remote execution in Chrome for Katalon Studio, follow these steps:
- In the node machine
- In the test runner machine: The test runner machine is where you install Katalon Studio and store the test scripts.