Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Calling Listener through TestSuite class



I’m running a TestSuite in Java, which contains several Junit/TestNG tests.
I’m looking to integrate the result reporting to TestRail.

I’ve seen several postings/samples about how this has been done by others but those I’ve found have used a main class and called a listener inside the main class.

In my case I don’t have a main method.
I have a TesSuite class with setupsuite and teardownSuite methods.

My Question is this.

I want to report back results for the whole TestSuite (600- 700).
So my suggestion would be to create the listener and call it from the TestSuite class itself.
I believe this scenario should then require me to call the API from the TestSuite class itself also to assign the results back.

I’d like to hear any opinions from somebody who’s done it this way.
Do i understand it correctly? Have I got a good handle on how to approach this?

Many thanks,