How can I make a test fail when I find an object?

How can I stop the test?
and make it fail

use

WebUI.verifyElementNotPresent(TestObject,FailureHandling.STOP_ON_FAILURE)
1 Like