Go into an if statement if an element is visible on the website

The verifyElementVisible() method acts as an assertion, which means that if the element in question isn’t visible, it’s considered a failure, the test stops, and the boolean value returned by the method doesn’t even get evaluated by the if statement.

You can have the test continue by utilizing the version of the verifyElementVisible() method that accepts a FailureHandling argument:

if(WebUI.verifyElementVisible(findTestObject('Page_CuraAppointment/div_Appointment'), FailureHandling.CONTINUE_ON_FAILURE))

3 Likes