Making a Test Case fail after Passes

Here is a good one…
I can create a user
Log back in as admin and delete the user

all good

but I want a peace of mind and So I tried to make it fail and can’t

type in the email
Get Text when search results come back
If the user email exists Fail TC
Else print Yes

@rthomfohrde I am not able to understand what you are trying to do with this test case.

Can you please post your whole script ?

WebUI.callTestCase(findTestCase(‘Automation/_Sign In GovSpend Automation’), [:], FailureHandling.STOP_ON_FAILURE)

WebUI.click(findTestObject(‘Left Menu_OR/menu_Admin’))

WebUI.delay(10)

WebUI.setText(findTestObject(‘Admin_OR/Page_Admin Organization GovSpend/input_Email Filter’), ‘Test5@mailinator.com’)

not_run: WebUI.click(findTestObject(‘Admin_OR/Page_Admin Organization GovSpend/link_Agency Tester’))

not_run: WebUI.click(findTestObject(‘Admin_OR/Page_Organization Users GovSpend/tab_Details’))

not_run: WebUI.click(findTestObject(‘Admin_OR/Page_Organization Details GovSpend/button_Delete Org’))

WebUI.delay(3)

not_run: WebUI.click(findTestObject(‘Admin_OR/Page_Organization Details GovSpend/button_Delete confirm’))

not_run: WebUI.setText(findTestObject(‘Admin_OR/Page_Admin Organization GovSpend/input_Email Filter’), ‘test5@@mailinator.com’)

result = WebUI.getText(findTestObject(‘Left Menu_OR/Page_Admin Organization GovSpend/text_User email’))

//result = WebUI.getText(findTestObject(‘Admin_OR/Page_Admin Organization GovSpend/text_Test Tester (test5mailinatorcom)’))

if (result.contains(‘test5@@mailinator.com’)) {
KeywordUtil.markFailed
} else {
println(‘YES’)
}