@ThanhTo @devalex88 @duyluong
Guys, keep in mind when you read this, I don’t use these APIs, so it doesn’t really matter to me, but, as someone trying to help others, now I have a problem:
Thanh - the expectations are going to vary based on two use-cases:
- The boolean aspect
- The FailureHandling aspect
What we have is one “thing” (
verifyElementPresent) documented as offering two things but failing to do one of them:
- Return true/false based on presence/absence. (PASS)
- Support FailureHandling as per the docs. (FAIL at least when STOP_ON_FAILURE is used)
FailureHandling, as I understand it, is meant as an interface on to Katalon’s TestCase state management (they end up as throws in many cases, right?) But…
verifyElementPresent now ignores
STOP_ON_FAILURE then it seems fair to say the FailureHandling argument has no purpose, or worse, only partial purpose. If so, then it doesn’t “match the expectations against the documentation”. You have a TestCase step that cannot fail - have I got that right?
I took a look at VerifyElementPresentKeyword.groovy and WebUIKeywordMain.groovy but my mental closure parser threw a StackOverflowException To totally grok it I’d need to step it through properly.
Therefore this is still buggy if only because the documentation is now wrong. If I’ve said
STOP_ON FAILURE as both…
- a parameter to the method
- AND as my default handling setting
and NEITHER can stop a test case, that’s a 100%, bona fide, de facto bug.
Repeat. I don’t use this stuff so it doesn’t really matter to me, personally. But now I can’t support/help users understand what STOP_ON_FAILURE even means.
My advice, for what it’s worth: deprecate WebUI, begin work on WebUI2 and fix all these irksome pain points.
Sorry if this was a ramble (been here 19 hours!)
 It’s rarely a good idea to have one thing do two jobs: https://en.wikipedia.org/wiki/Single_responsibility_principle. Yeah, I know, we can all end up with tangles like this but that’s what the route cause is here – you have tension between a boolean and a throwable. It’s an arms race no one can win.