I understand that you work on the Manual mode of a Test Case:
I understand your rational. But I think Katalon Studio is not implemented as such.
Katalon Studio does not provide any way for you to catch the value returned by a call to a method annotated with
com.kms.katalon.core.annotation.SetUp. When you ran a Test Case, Katalon Studio implicitly calls the method with
@SetUp annotation. But KS silently ignores any returned value.
I suppose Katalon Studio should have been designed NOT to allow you to assign any returning type for a method marked as “SetUp”. KS should rather have been designed to assign void type forcibly to “SetUp”-annotated methods.
I suppose it is a design failure of KS that it pretends to be allowing users including @just-passin-thru to return value from the SetUp method into the Test Case body.
any comment from Katalon team?
How can I be so confindent that KS is wrongly designed?
I will tell you why. @Setup, @TearDown — any well-trained Java programmers know that those vocabularies come from the famous unit-testing frameworkd JUnit4. I believe that JUnit is an intellectual background for all Java programmers to which Katalon developers belong as well. See the API document of @SetUp annotation:
This doc writes:
public void method with
@Before causes that method to be run before the
Anyone who knows JUnit expects that any
SetUp-type of methods would/should be of
void type; it is unquestionable common sense.
A SetUp method that returns value — it looks rather odd to me.