Launch Test Listeners within Web recorder?

I developped a TestListener which automatically manage authentication for all my test cases.

Problem is that this listener is not launched when launching existing test trough “web recorder”, so it is hard to modify existing test cases.

Is is possible to trigger “Test Listeners” when launching “Run all steps” in web recorder ?

You can put your authentication code into a test case, and then call it using WebUI.callTestCase and it will be executed even when using Web Recorder.

My goal was to avoid to put duplicate code and to help testers to easilly edit test scenarios without adding extra

But if it is the only way, ok I will do that

Thank you for your answer

1 Like

Step 1: Launch Katalon Studio and click New > Test Case on the main toolbar. …
Step 2: Click Record Web from the main toolbar.
Step 3: The Record dialog will be displayed.
Step 4: Select a browser, then click Record to start recording the test case.

finally, I will remove my test listeners and will ask testers to systematically add first line : WebUI.callTestCase(findTestCase('Common Test Cases/Authentication'), [:], FailureHandling.STOP_ON_FAILURE)

1 Like