How to use TestNG Listeners with Cucumber
<p>I am triyng to write testng listeners for my testing project cucumber, testng, selenium and java.</p>

<p>I have created Listeners extends TestListenerAdapter and implemented all the methods and included in testng.xml </p>

<pre><code>`&lt;listeners&gt; &lt;listener class-name="TestNGListeners.Listeners"&gt;&lt;/listener&gt;
`&lt;test name="Smoke"&gt; 
`&lt;packages&gt; &lt;package name="cucumber.runner.*"&gt; &lt;/package&gt;
`&lt;/test&gt;  
</code></pre>

<p>This xml calling a testrunner class RunCukesTest</p>

<pre><code>`@CucumberOptions(features ="classpath:features",
`glue ="stepDefinitions",
 tags="@tag_Login2",        
 plugin={"pretty", "html:target/cucumber-html-report",
 "json:target/cucumber-report.json"}
 )

 `public class RunCukesTest {

  `@Test()
  `public void run_cukes () throws IOException {
  `System.out.println("Run Cuke is started..");
  `TestNGCucumberRunner tr = new TestNGCucumberRunner(getClass());
  `tr.runCukes();  }
  `}
</code></pre>

<p>which is responsible for running all cucumber tests.</p>

<p>After running it I am not getting any response from my listener methods. Please help me to find the solution.</p>

<p>Example -: Whenever I want to run suite or runner these method should work so that I can write my functionality :</p>

<pre><code> public void onTestSuccess(ITestResult tr){

        if( ITestResult.SUCCESS==  tr.SUCCESS)
        {
            System.out.println("Test result PASS..");
        }


    } 
</code></pre>