FailureHandling.OPTIONAL custom message print issue using KeywordUtil

As per the forum solution, if a statement including FailureHandling.OPTIONAL fails to run then using KeywordUtil.markErrorAndStop("i am failed ") custom message should print, but when the statement is passed KeywordUtil.markErrorAndStop("i am failed ") this statement should not run. So my issue is this statement KeywordUtil.markErrorAndStop("i am failed ") is executing in both the cases. for better understanding I have attached the code.

WebUI.setText(findTestObject('Page_Facebook log in or sign up/input_email'), 'ayx@gmail.com', FailureHandling.OPTIONAL)

if(FailureHandling.OPTIONAL == what should come here ? )
{
KeywordUtil.markErrorAndStop("i am failed ")
}
else
{
this statement should run
}
in this case only else part should run but if part is running. PLEASE PROVIDE Solution
i know Failurehandling is enum, but how should i compare and against which in if statement: for ex: if(FailureHandling.OPTIONAL == true ) something like this possible. ~~~~

Tagged:
Sign In or Register to comment.