SetUp method is not being executed

I need to appointment sessions to be created before proceeding with a booking. I am using setUp method for the same. But it never gets executed. What am I doing wrong?
How can I have some steps getting executed before actual test case starts running?

1 Like

What is setUp method you mean?

Which page of the Katalon document you found the setUp method is supported?

Do you expect Katalon to execute test script written in the way of JUnit?

No, Katalon is not like JUnit.

I was referring to this - Test Fixtures and Test Listeners (Test Hooks) in Katalon Studio | Katalon Docs
To run a few steps before actual test case execution

1 Like

Yes, I found the following description in the Katalon doc.

I examined this.
I tried to define a method annotated with com.kms.katalon.core.annotation.SetUp in a Test Case.
It worked just fine.
See the following example.

Possibly your observation is wrong.

Possibly the setup method was executed.
But the method failed to launch a browser.
Therefore you got a message “Browser is not opened”.

The reason of the failure is unknown.
Only you can investigate it.

By the way, I did not know the “SetUp method in a Test Case”. I have never used this. I suppose that nobody (but you @kirankukreja51) uses it.

IMHO, @SetUp and @TearDown annotation in a Test Case is not worth learning and using. It looks to me a kind of joke.

Why is it a joke? Let me explain it.

The following 2 Test Cases behaves just the same.

def setup() {
	println "Hello, world!"
println "Good morning"

println "Hello, world!"
println "Good morning"

The former code looks to me a joke.

I was trying to implement a solution using setup just for learning purpose. Katalon skips the setup method and directly executes the next step which needs browser to be opened. I verified this in logs and after changing the setup code.
But anyways, I agree that it is not very useful to use setup on test case level.
Thank you for your inputs.

It’s okay, everyone is learning :smile: