As we all
are aware reporting is an integral and very important part of any testing
automation framework. Normally in any testing framework, we use either default
TestNg Report, Allure Report or most widely used as Extent Report. We already have seen
in my other blogs how we can set up an extent report in TestNg and Cucumber.
In this blog
we are going to learn how to set up this newly introduced extent report Version 4 in
Selenium along with TestNG.
1) Download Extent report maven
dependency or Jar from maven repository using this link.
In this blog for demo purposes, I would be using below maven dependency.
2) In the below code I have written two test cases
to validate Tittle and logo on Google home page. Also captured screenshot in
case of any failure in Test Case. Comments are also added along with code for
better understanding.
Result of code execution would be :
Result of code execution would be :
as per your TC2 validation. 'ImagePresentNo' should get failed in the validation because of getting true flag. But in extent report it get highlighted as PASS log report. Could you clarify. Thanks
ReplyHi in TC 2,if you observe i have created 2 nodes first one with image(true) which actually got passed,other one with image(false) which got failed.Though that failure its not visible in the screenshot i shared in the blog :)
ReplyThanks for your reply. yes it should fail. I meant ImagePresentNo node highlighted as Green with PASS tag. That's my concern.
ReplyHi,
ReplyI am working on the same code,for working fine as mentioned in above,but report only created and but screenshots are creating.may i know what is the issue i am facing in my code.using same code whatever u mentioned above.
Hi Vishnu,
ReplySorry but i am not clear with your question.Request you to please share your detailed question along with Screenshot on my email id: ankur.jain.cs@gmail.com.Surely i would reply back to you :)
How to differentiate test cases based on module name.. I want to generate report Module wise testcases
ReplyHow to add extent-config.xml file in this extent report code for adding the customize logo?
ReplyHi
ReplyIf I want to run the test class from testng.xml what changes I need to do can you please help me in that
Hi,
ReplyI want to print test steps in the console, how to achieve this can you help me out.
Hello,
ReplyThank you for the tutorial. When I tried this code it is working fine , but when I tried to create a utility extent class and call in page classes in pom framework , test=extent.create("String name ") is throwing nullpointer exception . Can you please help me out?
how will you get total steps executed in all nodes ?
Reply