If the element is not visible the step will fail without you needing to add a FailureHandling, the element may still be visible even though it is invisble to you which is why the step is passing - try WaitForElementPresent instead
2019-02-19 13:11:39.035 e[39mDEBUGe[0;39m e[36mtestcase.New Test Case -e[0;39m e[39m3: waitForElementVisible(findTestObject(“Objects/Attributes Page/AttributeCode”), 10, STOP_ON_FAILURE)e[0;39m
2019-02-19 13:11:49.422 e[34mINFO e[0;39m e[36mc.k.k.c.webui.common.WebUiCommonHelper -e[0;39m e[39mUnable to find the element located by ‘By.xpath: //input[@name=‘codeField’]’. Please recheck the objects properties to make sure the desired element is located. e[0;39m
2019-02-19 13:11:49.422 e[31mWARN e[0;39m e[36mk.k.c.w.k.b.WaitForElementVisibleKeyword -e[0;39m e[39mWeb element with id: ‘Object Repository/Objects/Attributes Page/AttributeCode’ located by ‘By.xpath: //input[@name=‘codeField’]’ not founde[0;39m
2019-02-19 13:11:49.423 e[39mDEBUGe[0;39m e[36mtestcase.New Test Case -e[0;39m e[39m4: closeBrowser()e[0;39m
Test Cases/New Test Case
PASSED
2019-02-19 13:11:50.173 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39mEND Test Cases/New Test Casee[0;39m
If the “wait for” keyword is intended to be used this way, it should be reflected in the docs.
The flowControl parameter description states:
Specify failure handling schema to determine whether the execution should be allowed to continue or stop
This implies the use of flowControl can be used to mark the keyword as failed and stop execution.
The log output below shows waitForElementVisible being called on an element that is not present. It is called 3 times to show the result of all failure handling options. A WARN is thrown regardless of the setting and the execution continues. So why is this parameter offered in the first place?
2019-09-27 16:22:30.358 DEBUG testcase.Open browser to DV2 - 5: waitForElementVisible(findTestObject(“Login/button_Login”), 2, CONTINUE_ON_FAILURE)
2019-09-27 16:22:30.363 DEBUG c.k.k.core.testobject.ObjectRepository - Finding Test Object ‘Object Repository/Login/button_Login’
2019-09-27 16:22:30.522 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking object
2019-09-27 16:22:30.523 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking timeout
2019-09-27 16:22:30.525 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking timeout
2019-09-27 16:22:30.530 DEBUG c.k.k.c.webui.common.WebUiCommonHelper - Finding web element with id: ‘Object Repository/Login/button_Login’ located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’ in ‘2’ second(s)
2019-09-27 16:22:32.584 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’. Please recheck the objects properties to make sure the desired element is located.
2019-09-27 16:22:32.600 WARN k.k.c.w.k.b.WaitForElementVisibleKeyword - Web element with id: ‘Object Repository/Login/button_Login’ located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’ not found
2019-09-27 16:22:32.601 DEBUG testcase.Open browser to DV2 - 6: waitForElementVisible(findTestObject(“Login/button_Login”), 2, OPTIONAL)
2019-09-27 16:22:32.602 DEBUG c.k.k.core.testobject.ObjectRepository - Finding Test Object ‘Object Repository/Login/button_Login’
2019-09-27 16:22:32.660 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking object
2019-09-27 16:22:32.661 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking timeout
2019-09-27 16:22:32.661 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking timeout
2019-09-27 16:22:32.661 DEBUG c.k.k.c.webui.common.WebUiCommonHelper - Finding web element with id: ‘Object Repository/Login/button_Login’ located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’ in ‘2’ second(s)
2019-09-27 16:22:34.699 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’. Please recheck the objects properties to make sure the desired element is located.
2019-09-27 16:22:34.700 WARN k.k.c.w.k.b.WaitForElementVisibleKeyword - Web element with id: ‘Object Repository/Login/button_Login’ located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’ not found
2019-09-27 16:22:34.701 DEBUG testcase.Open browser to DV2 - 7: waitForElementVisible(findTestObject(“Login/button_Login”), 2, STOP_ON_FAILURE)
2019-09-27 16:22:34.701 DEBUG c.k.k.core.testobject.ObjectRepository - Finding Test Object ‘Object Repository/Login/button_Login’
2019-09-27 16:22:34.756 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking object
2019-09-27 16:22:34.756 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking timeout
2019-09-27 16:22:34.756 DEBUG c.kms.katalon.core.helper.KeywordHelper - Checking timeout
2019-09-27 16:22:34.757 DEBUG c.k.k.c.webui.common.WebUiCommonHelper - Finding web element with id: ‘Object Repository/Login/button_Login’ located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’ in ‘2’ second(s)
2019-09-27 16:22:36.796 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’. Please recheck the objects properties to make sure the desired element is located.
2019-09-27 16:22:36.797 WARN k.k.c.w.k.b.WaitForElementVisibleKeyword - Web element with id: ‘Object Repository/Login/button_Login’ located by ‘By.xpath: //button[@type = ‘submit’ and (text() = ‘Log in’ or . = ‘Log in’)]’ not found