How can we handle recovery scenario

Is there any way to handle recovery scenario with katalon studio web testing?

  • recovery scenario
    Suppose you have test that need to login to system to carryout the test
    but test getting fail before logout from the system. - then browser will close without logout.
    if test getting fail, is there any way to logout from the system before browser close (even fail the test)

Hi sudam_wellappuli

What do you worry about the user session after closing the browser and need the handle to remove it? Can you recheck if the browser has closed (due to failed tests) it will automatically remove user session on the browser or not?
If the user session has destroyed after closing the browser, it should be the same as logged out.

1 Like

I think this is what you’re looking for:

1 Like

When browser close it is not removing the session. what is happening session hanging on the server. when there are huge number of test cases those are getting fail; all session getting hang. there will be hit for the server.

this is for after suite or after test, but if test case getting fail middle of the test. how can we use listeners ?

This is the entire point of test listeners. They are meant to run every time, regardless of whether your test fails in the middle. You would need a @AfterTestCase listener, like this:

def logOutAfterTestCaseEnds(TestCaseContext testCaseContext) {
	// code to log out
1 Like

Thanks everyone for your time !

1 Like

We’re you able to use Test Listeners? Or did you try another approach? :slightly_smiling_face: