what is the difference between creating extent report by using listener and without using listener












2















I want to generate an extent report but I am confused as to the difference between creating the extent report by using listener and without using listener?



I am done writing the code for both but I can`t see the difference and which one is better because it looks same and the outcome result also same. Can anyone explain to me which one is better? Below attached my sample code, when I remove listener still can get the same result :



Listener.java



package listener;
public class Listener implements ITestListener {
ExtentTest test;
public void onTestStart(ITestResult result) {
System.out.println("on test start");

}
public void onTestSuccess(ITestResult result) {
System.out.println("on test success");
}
public void onTestFailure(ITestResult result) {
System.out.println("on test failure");
result.getThrowable();
}
public void onTestSkipped(ITestResult result) {
System.out.println("on test skipped");
result.getThrowable();
}
public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
System.out.println("on test sucess within percentage");
}
public void onStart(ITestContext context) {
System.out.println("on start");

}
public void onFinish(ITestContext context) {
System.out.println("on finish");
} }


BaseTest.java



public class BaseTest {
public AppiumDriver<WebElement> driver;
ExtentReports extent;
ExtentTest test;

String timeStamp = new SimpleDateFormat("EEE-d-MMM-yyyy.HH-mm-ss ").format(new Date());
String fileName = System.getProperty("user.dir") + "/result/report" + timeStamp + ".html";
ExtentHtmlReporter htmlReports;
@Parameters("deviceModel")
@BeforeTest
public void setUp() throws MalformedURLException {
htmlReports = new ExtentHtmlReporter(fileName);
extent = new ExtentReports();
extent.attachReporter(htmlReports);
htmlReports.config().setReportName("Testing");
htmlReports.config().setTheme(Theme.STANDARD);
htmlReports.config().setTestViewChartLocation(ChartLocation.BOTTOM);
htmlReports.config().setDocumentTitle("HtmlResultTest");

System.out.println("Session is creating");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "ios");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.3.3");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Agmo");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Safari");
driver = new IOSDriver<WebElement>(new URL("http://localhost:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
System.out.println("Session is created");
}

@AfterTest
public void tearDown() {
extent.flush();
}

@AfterMethod
public void checkResults(ITestResult testResult){
if (testResult.getStatus()==ITestResult.FAILURE){
test.log(Status.FAIL, "Test case is failed because of below problem");
test.log(Status.FAIL, testResult.getThrowable());
}else if (testResult.getStatus()==ITestResult.SUCCESS){
test.log(Status.PASS, "Test case is passed");
}else if (testResult.getStatus()==ITestResult.SKIP){
test.log(Status.SKIP, testResult.getThrowable());
}
} }


Testing.java



public class Testing extends BaseTest {
@Test(priority = 0)
public void InvalidVerificationCode() {
test = extent.createTest("Invalid code");
System.out.println("Starting test " + new Object() {}.getClass().getEnclosingMethod().getName());
driver.get("https://r2c2-staging.azurewebsites.net");
try {
driver.findElement(By.xpath("//button[@class="btn btn-white-green" and @type="button"]")).click();
driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="text"]")).sendKeys("sarinadia+2@agmostudio.com");
driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="password"]")).sendKeys("12345");
driver.findElement(By.xpath("//button[@class="signInBtn" and @type="submit"]")).click();
}catch (Exception e){
driver.findElement(By.xpath("//div[@class="title"]")).click();
}
driver.findElement(By.xpath("//img[@class="ng-star-inserted"]")).click();
driver.findElement(By.xpath("//div[@class="logout"]")).click();
driver.findElement(By.xpath("//button[@class="btn btn-white-green" and @type="button"]")).click();
driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="text"]")).sendKeys("sarinadia+2@agmostudio.com");
driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="password"]")).sendKeys("12345");
driver.findElement(By.xpath("//button[@class="signInBtn" and @type="submit"]")).click();
try{
driver.findElement(By.xpath("//div[@class="logout" and @text="Logout"]"));
}catch (Exception e){
String actual_error = driver.findElement(By.xpath("//div[@class="modal-content"]")).getText();
Assert.assertTrue(actual_error.contains("The user name or password provided is incorrect"));
driver.findElement(By.xpath("//button[@class="btn btn-primary ok" and @type="button"]")).click();
System.out.println("Tess login with invalid verification code pass!!n");
}
}


File.xml



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="tests">
<listeners>
<listener class-name="Listener"/>
</listeners>
<test name="Test ios">
<parameter name="deviceModel" value="Agmo" />
<classes>
<class name="Testing">
<methods>
<include name="InvalidVerificationCode"/>
</methods>
</class>
</classes>
</test>
</suite>









share|improve this question





























    2















    I want to generate an extent report but I am confused as to the difference between creating the extent report by using listener and without using listener?



    I am done writing the code for both but I can`t see the difference and which one is better because it looks same and the outcome result also same. Can anyone explain to me which one is better? Below attached my sample code, when I remove listener still can get the same result :



    Listener.java



    package listener;
    public class Listener implements ITestListener {
    ExtentTest test;
    public void onTestStart(ITestResult result) {
    System.out.println("on test start");

    }
    public void onTestSuccess(ITestResult result) {
    System.out.println("on test success");
    }
    public void onTestFailure(ITestResult result) {
    System.out.println("on test failure");
    result.getThrowable();
    }
    public void onTestSkipped(ITestResult result) {
    System.out.println("on test skipped");
    result.getThrowable();
    }
    public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
    System.out.println("on test sucess within percentage");
    }
    public void onStart(ITestContext context) {
    System.out.println("on start");

    }
    public void onFinish(ITestContext context) {
    System.out.println("on finish");
    } }


    BaseTest.java



    public class BaseTest {
    public AppiumDriver<WebElement> driver;
    ExtentReports extent;
    ExtentTest test;

    String timeStamp = new SimpleDateFormat("EEE-d-MMM-yyyy.HH-mm-ss ").format(new Date());
    String fileName = System.getProperty("user.dir") + "/result/report" + timeStamp + ".html";
    ExtentHtmlReporter htmlReports;
    @Parameters("deviceModel")
    @BeforeTest
    public void setUp() throws MalformedURLException {
    htmlReports = new ExtentHtmlReporter(fileName);
    extent = new ExtentReports();
    extent.attachReporter(htmlReports);
    htmlReports.config().setReportName("Testing");
    htmlReports.config().setTheme(Theme.STANDARD);
    htmlReports.config().setTestViewChartLocation(ChartLocation.BOTTOM);
    htmlReports.config().setDocumentTitle("HtmlResultTest");

    System.out.println("Session is creating");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "ios");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.3.3");
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Agmo");
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Safari");
    driver = new IOSDriver<WebElement>(new URL("http://localhost:4723/wd/hub"), capabilities);
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    System.out.println("Session is created");
    }

    @AfterTest
    public void tearDown() {
    extent.flush();
    }

    @AfterMethod
    public void checkResults(ITestResult testResult){
    if (testResult.getStatus()==ITestResult.FAILURE){
    test.log(Status.FAIL, "Test case is failed because of below problem");
    test.log(Status.FAIL, testResult.getThrowable());
    }else if (testResult.getStatus()==ITestResult.SUCCESS){
    test.log(Status.PASS, "Test case is passed");
    }else if (testResult.getStatus()==ITestResult.SKIP){
    test.log(Status.SKIP, testResult.getThrowable());
    }
    } }


    Testing.java



    public class Testing extends BaseTest {
    @Test(priority = 0)
    public void InvalidVerificationCode() {
    test = extent.createTest("Invalid code");
    System.out.println("Starting test " + new Object() {}.getClass().getEnclosingMethod().getName());
    driver.get("https://r2c2-staging.azurewebsites.net");
    try {
    driver.findElement(By.xpath("//button[@class="btn btn-white-green" and @type="button"]")).click();
    driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="text"]")).sendKeys("sarinadia+2@agmostudio.com");
    driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="password"]")).sendKeys("12345");
    driver.findElement(By.xpath("//button[@class="signInBtn" and @type="submit"]")).click();
    }catch (Exception e){
    driver.findElement(By.xpath("//div[@class="title"]")).click();
    }
    driver.findElement(By.xpath("//img[@class="ng-star-inserted"]")).click();
    driver.findElement(By.xpath("//div[@class="logout"]")).click();
    driver.findElement(By.xpath("//button[@class="btn btn-white-green" and @type="button"]")).click();
    driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="text"]")).sendKeys("sarinadia+2@agmostudio.com");
    driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="password"]")).sendKeys("12345");
    driver.findElement(By.xpath("//button[@class="signInBtn" and @type="submit"]")).click();
    try{
    driver.findElement(By.xpath("//div[@class="logout" and @text="Logout"]"));
    }catch (Exception e){
    String actual_error = driver.findElement(By.xpath("//div[@class="modal-content"]")).getText();
    Assert.assertTrue(actual_error.contains("The user name or password provided is incorrect"));
    driver.findElement(By.xpath("//button[@class="btn btn-primary ok" and @type="button"]")).click();
    System.out.println("Tess login with invalid verification code pass!!n");
    }
    }


    File.xml



    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
    <suite name="Suite" parallel="tests">
    <listeners>
    <listener class-name="Listener"/>
    </listeners>
    <test name="Test ios">
    <parameter name="deviceModel" value="Agmo" />
    <classes>
    <class name="Testing">
    <methods>
    <include name="InvalidVerificationCode"/>
    </methods>
    </class>
    </classes>
    </test>
    </suite>









    share|improve this question



























      2












      2








      2








      I want to generate an extent report but I am confused as to the difference between creating the extent report by using listener and without using listener?



      I am done writing the code for both but I can`t see the difference and which one is better because it looks same and the outcome result also same. Can anyone explain to me which one is better? Below attached my sample code, when I remove listener still can get the same result :



      Listener.java



      package listener;
      public class Listener implements ITestListener {
      ExtentTest test;
      public void onTestStart(ITestResult result) {
      System.out.println("on test start");

      }
      public void onTestSuccess(ITestResult result) {
      System.out.println("on test success");
      }
      public void onTestFailure(ITestResult result) {
      System.out.println("on test failure");
      result.getThrowable();
      }
      public void onTestSkipped(ITestResult result) {
      System.out.println("on test skipped");
      result.getThrowable();
      }
      public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
      System.out.println("on test sucess within percentage");
      }
      public void onStart(ITestContext context) {
      System.out.println("on start");

      }
      public void onFinish(ITestContext context) {
      System.out.println("on finish");
      } }


      BaseTest.java



      public class BaseTest {
      public AppiumDriver<WebElement> driver;
      ExtentReports extent;
      ExtentTest test;

      String timeStamp = new SimpleDateFormat("EEE-d-MMM-yyyy.HH-mm-ss ").format(new Date());
      String fileName = System.getProperty("user.dir") + "/result/report" + timeStamp + ".html";
      ExtentHtmlReporter htmlReports;
      @Parameters("deviceModel")
      @BeforeTest
      public void setUp() throws MalformedURLException {
      htmlReports = new ExtentHtmlReporter(fileName);
      extent = new ExtentReports();
      extent.attachReporter(htmlReports);
      htmlReports.config().setReportName("Testing");
      htmlReports.config().setTheme(Theme.STANDARD);
      htmlReports.config().setTestViewChartLocation(ChartLocation.BOTTOM);
      htmlReports.config().setDocumentTitle("HtmlResultTest");

      System.out.println("Session is creating");
      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "ios");
      capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.3.3");
      capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Agmo");
      capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Safari");
      driver = new IOSDriver<WebElement>(new URL("http://localhost:4723/wd/hub"), capabilities);
      driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
      System.out.println("Session is created");
      }

      @AfterTest
      public void tearDown() {
      extent.flush();
      }

      @AfterMethod
      public void checkResults(ITestResult testResult){
      if (testResult.getStatus()==ITestResult.FAILURE){
      test.log(Status.FAIL, "Test case is failed because of below problem");
      test.log(Status.FAIL, testResult.getThrowable());
      }else if (testResult.getStatus()==ITestResult.SUCCESS){
      test.log(Status.PASS, "Test case is passed");
      }else if (testResult.getStatus()==ITestResult.SKIP){
      test.log(Status.SKIP, testResult.getThrowable());
      }
      } }


      Testing.java



      public class Testing extends BaseTest {
      @Test(priority = 0)
      public void InvalidVerificationCode() {
      test = extent.createTest("Invalid code");
      System.out.println("Starting test " + new Object() {}.getClass().getEnclosingMethod().getName());
      driver.get("https://r2c2-staging.azurewebsites.net");
      try {
      driver.findElement(By.xpath("//button[@class="btn btn-white-green" and @type="button"]")).click();
      driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="text"]")).sendKeys("sarinadia+2@agmostudio.com");
      driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="password"]")).sendKeys("12345");
      driver.findElement(By.xpath("//button[@class="signInBtn" and @type="submit"]")).click();
      }catch (Exception e){
      driver.findElement(By.xpath("//div[@class="title"]")).click();
      }
      driver.findElement(By.xpath("//img[@class="ng-star-inserted"]")).click();
      driver.findElement(By.xpath("//div[@class="logout"]")).click();
      driver.findElement(By.xpath("//button[@class="btn btn-white-green" and @type="button"]")).click();
      driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="text"]")).sendKeys("sarinadia+2@agmostudio.com");
      driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="password"]")).sendKeys("12345");
      driver.findElement(By.xpath("//button[@class="signInBtn" and @type="submit"]")).click();
      try{
      driver.findElement(By.xpath("//div[@class="logout" and @text="Logout"]"));
      }catch (Exception e){
      String actual_error = driver.findElement(By.xpath("//div[@class="modal-content"]")).getText();
      Assert.assertTrue(actual_error.contains("The user name or password provided is incorrect"));
      driver.findElement(By.xpath("//button[@class="btn btn-primary ok" and @type="button"]")).click();
      System.out.println("Tess login with invalid verification code pass!!n");
      }
      }


      File.xml



      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
      <suite name="Suite" parallel="tests">
      <listeners>
      <listener class-name="Listener"/>
      </listeners>
      <test name="Test ios">
      <parameter name="deviceModel" value="Agmo" />
      <classes>
      <class name="Testing">
      <methods>
      <include name="InvalidVerificationCode"/>
      </methods>
      </class>
      </classes>
      </test>
      </suite>









      share|improve this question
















      I want to generate an extent report but I am confused as to the difference between creating the extent report by using listener and without using listener?



      I am done writing the code for both but I can`t see the difference and which one is better because it looks same and the outcome result also same. Can anyone explain to me which one is better? Below attached my sample code, when I remove listener still can get the same result :



      Listener.java



      package listener;
      public class Listener implements ITestListener {
      ExtentTest test;
      public void onTestStart(ITestResult result) {
      System.out.println("on test start");

      }
      public void onTestSuccess(ITestResult result) {
      System.out.println("on test success");
      }
      public void onTestFailure(ITestResult result) {
      System.out.println("on test failure");
      result.getThrowable();
      }
      public void onTestSkipped(ITestResult result) {
      System.out.println("on test skipped");
      result.getThrowable();
      }
      public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
      System.out.println("on test sucess within percentage");
      }
      public void onStart(ITestContext context) {
      System.out.println("on start");

      }
      public void onFinish(ITestContext context) {
      System.out.println("on finish");
      } }


      BaseTest.java



      public class BaseTest {
      public AppiumDriver<WebElement> driver;
      ExtentReports extent;
      ExtentTest test;

      String timeStamp = new SimpleDateFormat("EEE-d-MMM-yyyy.HH-mm-ss ").format(new Date());
      String fileName = System.getProperty("user.dir") + "/result/report" + timeStamp + ".html";
      ExtentHtmlReporter htmlReports;
      @Parameters("deviceModel")
      @BeforeTest
      public void setUp() throws MalformedURLException {
      htmlReports = new ExtentHtmlReporter(fileName);
      extent = new ExtentReports();
      extent.attachReporter(htmlReports);
      htmlReports.config().setReportName("Testing");
      htmlReports.config().setTheme(Theme.STANDARD);
      htmlReports.config().setTestViewChartLocation(ChartLocation.BOTTOM);
      htmlReports.config().setDocumentTitle("HtmlResultTest");

      System.out.println("Session is creating");
      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "ios");
      capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.3.3");
      capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Agmo");
      capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Safari");
      driver = new IOSDriver<WebElement>(new URL("http://localhost:4723/wd/hub"), capabilities);
      driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
      System.out.println("Session is created");
      }

      @AfterTest
      public void tearDown() {
      extent.flush();
      }

      @AfterMethod
      public void checkResults(ITestResult testResult){
      if (testResult.getStatus()==ITestResult.FAILURE){
      test.log(Status.FAIL, "Test case is failed because of below problem");
      test.log(Status.FAIL, testResult.getThrowable());
      }else if (testResult.getStatus()==ITestResult.SUCCESS){
      test.log(Status.PASS, "Test case is passed");
      }else if (testResult.getStatus()==ITestResult.SKIP){
      test.log(Status.SKIP, testResult.getThrowable());
      }
      } }


      Testing.java



      public class Testing extends BaseTest {
      @Test(priority = 0)
      public void InvalidVerificationCode() {
      test = extent.createTest("Invalid code");
      System.out.println("Starting test " + new Object() {}.getClass().getEnclosingMethod().getName());
      driver.get("https://r2c2-staging.azurewebsites.net");
      try {
      driver.findElement(By.xpath("//button[@class="btn btn-white-green" and @type="button"]")).click();
      driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="text"]")).sendKeys("sarinadia+2@agmostudio.com");
      driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="password"]")).sendKeys("12345");
      driver.findElement(By.xpath("//button[@class="signInBtn" and @type="submit"]")).click();
      }catch (Exception e){
      driver.findElement(By.xpath("//div[@class="title"]")).click();
      }
      driver.findElement(By.xpath("//img[@class="ng-star-inserted"]")).click();
      driver.findElement(By.xpath("//div[@class="logout"]")).click();
      driver.findElement(By.xpath("//button[@class="btn btn-white-green" and @type="button"]")).click();
      driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="text"]")).sendKeys("sarinadia+2@agmostudio.com");
      driver.findElement(By.xpath("//input[@class="ng-untouched ng-pristine ng-invalid" and @type="password"]")).sendKeys("12345");
      driver.findElement(By.xpath("//button[@class="signInBtn" and @type="submit"]")).click();
      try{
      driver.findElement(By.xpath("//div[@class="logout" and @text="Logout"]"));
      }catch (Exception e){
      String actual_error = driver.findElement(By.xpath("//div[@class="modal-content"]")).getText();
      Assert.assertTrue(actual_error.contains("The user name or password provided is incorrect"));
      driver.findElement(By.xpath("//button[@class="btn btn-primary ok" and @type="button"]")).click();
      System.out.println("Tess login with invalid verification code pass!!n");
      }
      }


      File.xml



      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
      <suite name="Suite" parallel="tests">
      <listeners>
      <listener class-name="Listener"/>
      </listeners>
      <test name="Test ios">
      <parameter name="deviceModel" value="Agmo" />
      <classes>
      <class name="Testing">
      <methods>
      <include name="InvalidVerificationCode"/>
      </methods>
      </class>
      </classes>
      </test>
      </suite>






      java testng listener extentreports






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 6:14









      Gerhard

      4,79233968




      4,79233968










      asked Nov 15 '18 at 4:53









      Nur Azmina HanisNur Azmina Hanis

      154




      154
























          1 Answer
          1






          active

          oldest

          votes


















          0














          No difference, just 2 ways of creating report.



          Although, looking at the code, your usage of Listener will not do anything as its just writing to console. The report is being generated from BaseTest only.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53312632%2fwhat-is-the-difference-between-creating-extent-report-by-using-listener-and-with%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            No difference, just 2 ways of creating report.



            Although, looking at the code, your usage of Listener will not do anything as its just writing to console. The report is being generated from BaseTest only.






            share|improve this answer




























              0














              No difference, just 2 ways of creating report.



              Although, looking at the code, your usage of Listener will not do anything as its just writing to console. The report is being generated from BaseTest only.






              share|improve this answer


























                0












                0








                0







                No difference, just 2 ways of creating report.



                Although, looking at the code, your usage of Listener will not do anything as its just writing to console. The report is being generated from BaseTest only.






                share|improve this answer













                No difference, just 2 ways of creating report.



                Although, looking at the code, your usage of Listener will not do anything as its just writing to console. The report is being generated from BaseTest only.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 21:55









                foursythfoursyth

                18819




                18819
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53312632%2fwhat-is-the-difference-between-creating-extent-report-by-using-listener-and-with%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Xamarin.iOS Cant Deploy on Iphone

                    Glorious Revolution

                    Dulmage-Mendelsohn matrix decomposition in Python