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

  Рет қаралды 7,995

LambdaTest

LambdaTest

Күн бұрын

Пікірлер: 10
@LambdaTest
@LambdaTest Жыл бұрын
📌 GitHub Repo: github.com/AutomateThePlanet/generate-extent-reports-in-selenium
@azizhalaouit9735
@azizhalaouit9735 8 ай бұрын
Very nice and easy to follow tutorial. Thanks for sharing.
@LambdaTest
@LambdaTest 8 ай бұрын
Glad to hear the tutorial was helpful for you! Do subscribe the channel for more such tutorials !🙂
@zexicc
@zexicc Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
I want your help
@LambdaTest
@LambdaTest Жыл бұрын
Sure, tell me how we can assist you.
@azizhalaouit9735
@azizhalaouit9735 7 ай бұрын
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 ай бұрын
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.
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 28 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 23 МЛН
Noodles Eating Challenge, So Magical! So Much Fun#Funnyfamily #Partygames #Funny
00:33
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 28 МЛН