Saturday, January 26, 2019

Post 2: Attaching Screenshot to failed tests in ExtentReports Version 4

In Post 1 we have learned generating the extent reports using ExtentReportsV4, in this postwe will learn about adding the screenshot to failed test cases. This will be continuation to Post 1, please go through it first then continue this.

Step 1: Update the pom.xml with Apache Commons IO dependency, as shown below. This required to copy the files.

Step 2: Now write a function in base class, that takes the screenshot and returns the path of the screenshot.

Step 3: We will call this function in @AfterMethod, this function will be invoked only when test failed.

Then using "addScreenCaptureFromPath(String path)" method of extent reports, the screenshot will be attached to the test in the extent report.

Check below, the screenshot is attached to failed test case.



#HappyLearning #HappyTesting

19 comments:

  1. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... איך בודקים איי קיו

    ReplyDelete
  2. So, how do you take a screenshot on a PC? There are several tools out there to accomplish this. One thing to consider is if you want to just take screenshots of web pages or of your desktop. screenshot guide

    ReplyDelete
  3. Not often do I encounter a weblog that is both educated and entertaining, and let me tell you, you may have hit the nail on the head. Your concept is excellent; the issue is something that not sufficient individuals are speaking intelligently about. I am very happy that I stumbled across this in my quest for something relating to this. app store mock up

    ReplyDelete
  4. Hi! Great post! Please do tell us when I will see a follow up! iphone screenshot template

    ReplyDelete
  5. Hey there! Nice stuff, please keep me posted when you post something like this! free imac mockup

    ReplyDelete
  6. I want to start a blog but would like to own the domain. Any ideas how to go about this?. imac template

    ReplyDelete
  7. Good write-up, I¡¦m normal visitor of one¡¦s blog, maintain up the nice operate, and It is going to be a regular visitor for a long time. imac mockups

    ReplyDelete
  8. Hi there, I found your blog via Google while searching for first aid for a heart attack and your post looks very interesting for me. mac desktop mockup

    ReplyDelete
  9. I simply couldn’t go away your website before suggesting that I actually enjoyed the standard information an individual provide on your visitors? Is gonna be back frequently in order to inspect new posts. app developer

    ReplyDelete
  10. I don’t even know how I ended up here, but I thought this post was great. I do not know who you are but certainly you are going to a famous blogger if you are not already Cheers! top web design companies

    ReplyDelete
  11. Hello! Good stuff, please keep us posted when you post again something like that! ui design agency

    ReplyDelete
  12. hello, your website is really good. We do appreciate your give good results top web development companies

    ReplyDelete
  13. hey, your internet site is excellent. We do appreciate your work logo design for startups

    ReplyDelete
  14. If someone is interested in finding a website to download capture software for their Windows, they must be set with the choices accessible over the Internet. how to screenshot on chromebook The people who are new to this kind of software may feel that the task of choosing the right website to download the software may be a bit scary at first.

    ReplyDelete
  15. Oh my goodness! an incredible article dude. Thank you However I am experiencing situation with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting an identical rss problem? Anyone who knows kindly respond. Thnkx best branding agencies san francisco

    ReplyDelete

Selenium4: Working with two parallel windows in Selenium Automation

A new method newWindow() is introduced in Selenium 4 (Alpha). Using this method we can open a new tab or new window from the current window...