verifyElementVisible return an error

Hello,
I use the expression “verifyElementVisible” to check if element is visible or not, but Katalon returns a response error when the element is not visible. Can you show me how to get only true or false as defined in Katalon docs.
The expected is : true/ false.
See Below :

There’s a typo in your failure handling argument. It should look like this:

def visible = WebUI.verifyElementVisible(findTestObject('path/to/object'), FailureHandling.CONTINUE_ON_FAILURE)

Have you had a chance to try this? Has it solved your issue?

Hello,
Thanks for your feedback, but i get an error too with this instruction :

2020-01-16 09:34:58.926 DEBUG testcase.Vp_Contrôle Chantier - 2: visible = verifyElementVisible(findTestObject(“Object Repository/FRED_Programme/FredWeb/01.Pointage/Page_FayatFRED/Pointage/Valider Lot de Pointage/01.Rb Contrôle Chantier”), CONTINUE_ON_FAILURE)

2020-01-16 09:34:59.828 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Object ‘Object Repository/FRED_Programme/FredWeb/01.Pointage/Page_FayatFRED/Pointage/Valider Lot de Pointage/01.Rb Contrôle Chantier’ is NOT visible (Root cause: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/FRED_Programme/FredWeb/01.Pointage/Page_FayatFRED/Pointage/Valider Lot de Pointage/01.Rb Contrôle Chantier’ is NOT visible

Alright in that case try the following failure handling argument instead:

FailureHandling.OPTIONAL

This should log a warning when the element is not visible, but the script should continue.

I’m using Katalon version 8.0.1 and still getting this error when using verifyElementVisible inside an IF statement. The log shows:

=============== ROOT CAUSE =====================
Caused by: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/myObject’ is NOT visible

How can a method to verify if an element is visible throws an exception “Object NOT visible”? that’s the target of the method, to verify that is or is not visible. If it’s not visible it should return ‘FALSE’ not an error. This behavior is completly non sense and it should be corrected. The FailureHandling workaround should be temporal.

I understand that you don’t want to see an Exception with verbose StackTrace printed, you just want to get boolean return value.

Then you should use “waitForElementVisible”, rather than “verifyElementVisible”.

These 2 keywords behaves the same when the condition is TRUE, but behaves different when the condition is FALSE. In case of FALSE, the “verifyElementVisible” throws an Exception with StackTrace. The “waitForElementVisible” won’t throw an Exception, will print a single line of message and return a boolean value.