How To Generate Extent Reports In Selenium📝| Selenium 4 Tutorial With Java | LambdaTest

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 10

  • @LambdaTest
    @LambdaTest  ปีที่แล้ว +1

    📌 GitHub Repo:
    github.com/AutomateThePlanet/generate-extent-reports-in-selenium

  • @azizhalaouit9735
    @azizhalaouit9735 7 หลายเดือนก่อน +1

    Very nice and easy to follow tutorial.
    Thanks for sharing.

    • @LambdaTest
      @LambdaTest  7 หลายเดือนก่อน

      Glad to hear the tutorial was helpful for you!
      Do subscribe the channel for more such tutorials !🙂

  • @zexicc
    @zexicc 11 หลายเดือนก่อน +2

    Hello. Thanks for the video tutorial. Is there a way for extent report to take test method name by itself automatically so I do not have to write extent parts of the code in test itself? Also to make it realise if it passed or failed?

    • @LambdaTest
      @LambdaTest  11 หลายเดือนก่อน

      Hey there,
      Yes, Extent Reports can automatically capture test method names and their execution status (pass/fail) without explicitly writing code in each test. This can be achieved by integrating Extent Reports with a test framework like TestNG or JUnit and using their listeners or annotations.

  • @aparnach6375
    @aparnach6375 ปีที่แล้ว +1

    I want your help

    • @LambdaTest
      @LambdaTest  ปีที่แล้ว

      Sure, tell me how we can assist you.

  • @azizhalaouit9735
    @azizhalaouit9735 7 หลายเดือนก่อน +1

    When a test is Annoteted with "@Disabled" the program generate the exception (java.lang.NullPointerException: Cannot invoke "com.aventstack.extentreports.ExtentTest.log(com.aventstack.extentreports.Status, com.aventstack.extentreports.markuputils.Markup)" because "com.xx.yy.ExecutionContext.CURRENT_EXTENT_TEST" is null
    at com.xx.yy..extentreports.ExtentTestListener.testDisabled(ExtentTestListener.java:13)
    ....
    and the test report fails to show correct test information. (Dashboard shows wrong information about tests status)
    Do you know why?

    • @LambdaTest
      @LambdaTest  7 หลายเดือนก่อน +1

      Hey there,
      The issue you're experiencing with @Disabled tests causing NullPointerException in your Extent Reports integration is not directly related to the version of Selenium, but rather how the test framework and your reporting setup interact. The core of the problem lies in how disabled tests are handled by your test listener and the lifecycle of ExtentTest objects within that context.
      Given the issue description, it seems your ExtentTestListener attempts to log a disabled test without checking if the ExtentTest instance (ExecutionContext.CURRENT_EXTENT_TEST) has been initialized, leading to a NullPointerException. This can happen because the initialization logic that typically runs before each test (e.g., in a @BeforeEach method) doesn't execute for @Disabled tests, so the ExtentTest instance remains null.
      To address this issue, you need to adjust your test listener to handle @Disabled tests properly. Here's a conceptual approach to solving this problem:
      Check for Null Before Logging: In your listener methods (e.g., testDisabled), add a null check for the ExtentTest instance before attempting to log anything. If the instance is null, you can either skip the logging for this test or initialize a new ExtentTest instance specifically for logging the disabled test.
      Global Initialization: Ensure that any required global initialization for your Extent Reports setup is performed outside of test-specific setup methods. This way, even if a test is skipped, the essential parts of your reporting infrastructure are ready to be used.