How to add Screenshot in Extent Report for Failed Test Cases in Selenium

  Рет қаралды 78,013

Naveen AutomationLabs

Naveen AutomationLabs

Күн бұрын

Пікірлер: 62
@tayal11991
@tayal11991 4 жыл бұрын
@naveen why didn't you add this in the existing POM Framework How to incorporate in the framework which you were developing in previous POM Framework videos
@AdventureMafia1
@AdventureMafia1 2 жыл бұрын
I have used simple basic Test ng framework taking screenshot and add to extent report but the problem is in all test methods I have called the screenshot method after end test while completing the after test annotated method the last taken screenshot was attached to all methods not taking the each method screen shot and adding into extent report. could you please provide me the solution.
@1911garima
@1911garima 2 жыл бұрын
Hi Naveen, Can you help us out by adding this feature of capturing screenshots for failed test cases, in the page object model which you developed in earlier videos? So that we will have robust framework
@rajpalyadavmitm
@rajpalyadavmitm 5 жыл бұрын
Thanks, please help how to send these reports through mail after execution, becuase while sending mail it attaches last execution report becuase for new report we need to refresh the test output folder . Then how we can send the newly generated report?
@harinat
@harinat 6 жыл бұрын
Hello Naveen, Thank you for video. Really appreciate your help. I have a question. How can i stop test not allowing to run remaining steps.I have 10 steps test case. I have assert statement at step3. If i just use assert statement and it fails, test throws error at step3 and stops running remaining test steps which i want. Now i am using extent report. I want to see this exception in report and then stop the test. How can i achieve this. If i use try catch to run step3 and capture exception to record it in reports log then , it will log the exception. But, test wont stop as we kept step3 as it is intry catch.
@deepgupta6796
@deepgupta6796 6 жыл бұрын
Hi Naveen, In your videos of extent report with screenshots, how to get screenshots attached to extent reports, when we have multiple test classes. Could you please make a video on the same. It will be of great help for us.
@CuriosityCove12
@CuriosityCove12 4 жыл бұрын
Please check my Git repo for this. It is completely based on Naveen's code so, it will be easy to understand. github.com/jainrohil/ExtentReportScreenshot
@nealbangia147
@nealbangia147 2 жыл бұрын
Sir how to add logs error in extent report?? Please add one video if possible
@rupambhartisingh
@rupambhartisingh 4 жыл бұрын
Hi naveen I am getting error for configuration . I used the same code but dont know its not getting run. FAILED CONFIGURATION: @AfterTest endReport java.lang.NullPointerException
@folsomindian
@folsomindian 3 жыл бұрын
to use ITestResult , don't we have to implement ITestListener interface?
@rajendransubramaniam3203
@rajendransubramaniam3203 6 жыл бұрын
Hi Naveen, I have corrected the mistake. I am able to capture the screenshot locally now(within TestNG). But now when I execute from Jenkins, it is not capturing properly. Image comes with blank box. Do we have to do any other settings. Kindly let me know.
@harshchoksi8471
@harshchoksi8471 2 жыл бұрын
I have 50 test cases so do I need to write in each 50 test method. extentTest = extent.startTest("TestTtile); I does not make sense Please work on export report NG for generating screenshot which is more reliable
@rajendransubramaniam3203
@rajendransubramaniam3203 6 жыл бұрын
Hi Naveen, Could you please help me on my previous issues. I followed your videos. I am able to capture the screenshots locally (within TestNG). But when I execute from Jenkins, it is not getting captured properly. Image comes with blank box. Do we have to do any other settings. Kindly let me know.
@prashantbankar9441
@prashantbankar9441 2 жыл бұрын
How to run these for multiple classes in same suite
@abhilashr7233
@abhilashr7233 6 жыл бұрын
Hi Naveen, In Extent reports it is showing only latest class results,can you explain me this? Or Suggest me How to display all the class results in Reports
@seelamsrinivas
@seelamsrinivas 6 жыл бұрын
Hi Naneen, Thanks for the video I have two classed in testng.xml, I am getting null pointer exception for extend report when I run the testng.xml. If the run run each java class individually then report generated successfully. I am giving the sample xml and some code. Please suggest me where I am doing wrong. Error: FAILED CONFIGURATION: @AfterMethod teardown([TestResult name=VerifyPrimeItemsinFirstPLP status=FAILURE java.lang.NullPointerException Testng.xml @BeforeTest public void startExtendReport() { extent = new ExtentReports(System.getProperty("user.dir") + "/test-output/TestReport.html", true); } @BeforeMethod public void setup() { initialize(); } @AfterMethod public void teardown(ITestResult result) throws IOException { if (result.getStatus() == ITestResult.FAILURE) { extentTest.log(LogStatus.FAIL, "Failed Test Case: " + result.getName()); extentTest.log(LogStatus.FAIL, "Log info" + result.getThrowable()); String imagePath = utility.getScreenShot(driver, result.getName()); extentTest.log(LogStatus.FAIL, "Screenshot" + extentTest.addScreenCapture(imagePath)); } else if (result.getStatus() == ITestResult.SKIP) { extentTest.log(LogStatus.SKIP, "Skipped Test Case: " + result.getName()); } else if (result.getStatus() == ITestResult.SUCCESS) { extentTest.log(LogStatus.PASS, "Success Test Case: " + result.getName()); } extent.endTest(extentTest); driver.close(); driver.quit(); } @AfterTest public void endExtentReport() { extent.flush(); extent.close(); }
@rajendransubramaniam3203
@rajendransubramaniam3203 6 жыл бұрын
Hi Naveen and Others, When I try to follow this video, screenshot is not getting captured properly. It captures like blank image. I could not see application's proper screen. Please suggest me how to resolve it?
@gauri361
@gauri361 6 жыл бұрын
Are you using implicit wait in your tests?
@kiranmore-tv7hs
@kiranmore-tv7hs 2 жыл бұрын
Hi Naveen. It is very nice explanation. Can you help me out for adding this feature of capturing screenshots for failed test cases, in the page object model which you developed in earlier videos?
@funnymarriagevideo2321
@funnymarriagevideo2321 6 жыл бұрын
Hi Naveen, i want only necessary info in error message on failure and avoid unnecessary details. Can you please let me know how to customize error msg.
@missiontech5864
@missiontech5864 3 жыл бұрын
How can I add screenshot to masterthought report using testng?
@umamaheswararao7121
@umamaheswararao7121 6 жыл бұрын
How to add this feature in our framework ? Your framework (POM) only I'm using. please suggest the recommended changes in in framework library.
@naveenkumark3018
@naveenkumark3018 4 жыл бұрын
Hi Naveen, how to make a extent report with using catch block the extent report with screen shot should be attached.. it has to run mulitiple testcase with one @test and it will catch in the catch block. if you make a video on this it will be helpful
@C_h_e_l_o
@C_h_e_l_o 7 жыл бұрын
Hi Naveen,if i want to take a picture from failed tests,but i have extend report class from your video(part 5) how can i implement the method and where to take screenshot if i want to run the tests from xml,because i want to write the nethod in 1 classand i dont want to use webeventlistener?or how do you integrate screen shot with the 6 parts project that you put on youtube but not how you did in part 5 but integrate with the ExtentReporterNG class thet you provide in PageObjectModel project .Thanks
@umamaheswararao7121
@umamaheswararao7121 6 жыл бұрын
I'm also having same doubt. Please suggest me if you got cleared. Thanks in advance.
@gauri361
@gauri361 6 жыл бұрын
You can use the listener class and implement the ITestListener interface. There are various unimplemented methods in ITestListener interface. you can write your logic of generating the extent report in those methods. like onStart(), onTestFailure(); etc This will work for all the methods that get executed and you do not need to add that in to xml file as listener. just declare the listener class before every test class. and your job is done.
@Viyaan_tho_Vinodham
@Viyaan_tho_Vinodham 6 жыл бұрын
how can i add listener in testng xml file, i added it but in result showing only last class result
@divyjain4564
@divyjain4564 6 жыл бұрын
@@gauri361 can you give example of how to add failure screenshot in extent report which is explained in part 5
@hstestingworld
@hstestingworld 4 жыл бұрын
I want solution for the same issue
@jigartailor3755
@jigartailor3755 6 жыл бұрын
Hi Naveen, In my html report, the images are broken. They are not displaying. Please help.
@navyachinnari
@navyachinnari 6 жыл бұрын
I'm getting below error message "Missing artifact com.releventcodes:extentreports:jar:2.41.2" Please help
@mrinalbhardwaj2583
@mrinalbhardwaj2583 3 жыл бұрын
Hi..you are not adding the correct dependency under POM.xml
@aarzoopatel7816
@aarzoopatel7816 2 жыл бұрын
Hello Naveen, can you please make the same video with POM? It would be appreciated.
@sajilch7052
@sajilch7052 3 жыл бұрын
hi sir, how add screenshot in pom frame work
@shalinirakesh3455
@shalinirakesh3455 4 жыл бұрын
Hi Naveen, Do you have turorial for Extend Report 3?
@himanshukhare1992
@himanshukhare1992 6 жыл бұрын
Can anyone please share the Right one ExtentReport jar please ???
@MK-jb8ks
@MK-jb8ks 6 жыл бұрын
hi Naveen thanks for sharing excellent video..Can you please let me know how to implement this concepts in POM as there are multiple pages for each web page..
@CuriosityCove12
@CuriosityCove12 4 жыл бұрын
Please check my Git repo for this. It is completely based on Naveen's code so, it will be easy to understand. github.com/jainrohil/ExtentReportScreenshot
@surajsurya1414
@surajsurya1414 4 жыл бұрын
Hi @@CuriosityCove12 , In your code you have defined method to add screenshot of failed test case under @AfterMethod for each one of your tests. I was looking to define that method in base class and call the method under @AfterMethod in my test so that the method can be reused in different test. Lik you have defined screenshot method in TestUtil class under package com.crm.qa.util. and can be used in any test. Naveen, any response regarding this will be very helpful. Thanks
@sonamjuly
@sonamjuly 6 жыл бұрын
Thanks a lot Sir. i really liked this.
@nandankabra9678
@nandankabra9678 Жыл бұрын
Images broken on other machines
@6jyoti
@6jyoti 3 жыл бұрын
Awesome 👍
@abhishekmane3787
@abhishekmane3787 2 жыл бұрын
Thank you so much 😀
@jeffreyperez4319
@jeffreyperez4319 6 жыл бұрын
Do you have codes for JUnit???
@littlelittle9936
@littlelittle9936 10 ай бұрын
Meri report hi generate nhi ho rhi
@divyjain4564
@divyjain4564 6 жыл бұрын
Hi Naveen, Great work and great explanation !! Thanks much I have 1 doubt related to extent report . You have shared 2 videos on extent report 1) kzbin.info/www/bejne/o2XVm6GFrdaWoMk Here we are just adding the extent report listener and map it in testng so based on testng execution , it is generating the report. In this case if we want to add screenshot as well , we can add webdrivereventlistener or testngeventlistener but its not attaching to extent report 2) kzbin.info/www/bejne/emWpnJuDp7RsnNk In this video, you showed how to attach screenshot to extent report Now query is which one of above is more effective way to add report Thanks in advance, Divy Jain
@naveenautomationlabs
@naveenautomationlabs 6 жыл бұрын
Divy Jain the second way.
@divyjain4564
@divyjain4564 6 жыл бұрын
Naveen AutomationLabs can you tell why not first way
@meenumangai5915
@meenumangai5915 6 жыл бұрын
thank u so much
@km2612
@km2612 7 жыл бұрын
Thanks for the video
@pandudamera158
@pandudamera158 7 жыл бұрын
Pls upload POM 5 (log4j) and POM6 extentrepot
@pandudamera158
@pandudamera158 7 жыл бұрын
Added share me u r GitHub repository Thank you
@naveenautomationlabs
@naveenautomationlabs 7 жыл бұрын
GIT URL is there in the video description
@pradeepbisht7346
@pradeepbisht7346 5 жыл бұрын
very hard to understand this one@@
How to Generate Log Files in Selenium using Log4j API
32:50
Naveen AutomationLabs
Рет қаралды 118 М.
Taking ScreenShot ONLY for Failed Tests in Selenium using TestNG Listener
32:12
Naveen AutomationLabs
Рет қаралды 118 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
TestNG Tutorial #16 - How to Capture Screenshot for Failed Tests in TestNG
18:22
Software Testing Mentor
Рет қаралды 32 М.
14. Extent Reports in java selenium framework
26:40
QA Automation Classes
Рет қаралды 6 М.
How to find broken links & Images using Selenium Webdriver
45:35
Naveen AutomationLabs
Рет қаралды 99 М.
What is HTML DOM & StaleElement Exception in Selenium
36:04
Naveen AutomationLabs
Рет қаралды 82 М.
How to take Screenshot in Selenium || Interview Question
13:37
Naveen AutomationLabs
Рет қаралды 94 М.
How to capture Screenshots for failed test cases in Selenium using TestNG Listeners
29:33
Integrate Extent Report and Logs in Framework
28:16
Mukesh otwani
Рет қаралды 61 М.