Introduction
Hey Readers!!
While working in Automation, the most common failure is waiting time.
In this article, you'll learn about solving wait time failure in Katalon Studio.

Wait
Wait for commands in automation testing to tell test execution to stop for a specific time before continuing to the next stage.
Examples of tests that failed due to insufficient wait time:
- False Fail: This failure occurs because of the waiting time on the application and leads to script failing.
- The Targeted element not present on the page: This failure occurs because of the time for the elements to be rendered in the browsers. Some of the elements may need to be loaded, which leads to the script failing.
How to address those failures related to Wait?
The following options can be used for the failures related to waiting:
- Wait for Page Load: This logic will delay starting a step in your script until a page has fully loaded.
- Wait For Element Present: Until the targeted element on the page appears, the present keyword blocks execution.
- Global variable: A global variable is a programming language construct declared outside of any function and available to all functions throughout the program.
Manual Mode

Script Mode
'Open browser and navigate to Coding Ninjas'
WebUI.openBrowser("https://coding ninjas.com")
'Wait for Katalon Studio page to load with the wait used as Global Variable'
WebUI.waitForPageLoad(GlobalVariable.G_Timeout_Small)
'Click on \'Login\' button to navigate to the Login page'
WebUI.click(findTestObject('Page_KatalonHomepage/btn_Login'))
'Input username'
WebUI.setText(findTestObject('Page_Login/txt_UserName'), Username)
'Input password'
WebUI.setText(findTestObject('Page_Login/txt_Password'), Password)
'Click on \'Login\' button to login'
WebUI.click(findTestObject('Page_Coding NInjas Homepage/btn_Submit'))
'Wait for failed message to be present'
WebUI.waitForElementPresent(findTestObject('Page_Coding NinjasLogin/div_LoginMessage'), GlobalVariable.G_Timeout_Small)
WebUI.closeBrowser()




