Search code examples
javaintellij-ideatestngextentreports

Cannot instantiate class utils.listeners.TestListener. Empty test suite


I want to generate extent report using testng in intellij, but when I run the xml file i got this kind of error. Can anyone help me to fix this error?

this is the error got

This is TestListener class

this is TestListener class

Xml Suite

this is xml file for test suite


Solution

  • Remove abstract in TestListener Class.

    You must implement all methods present ITestlistner even if you have nothing to do with that method. In your custom listener, you have missed one method.

    Add this empty method to your TestListener class

     @Override      
        public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {                  
            // TODO Auto-generated method stub              
    
        }