Your explaination is quite amazing, I have gone through tons of other videos in youtube but it was quite helpful. You've mastered the art of teaching without any though i've enrolled in course.Thanks a lot
Glad you liked it :) If you liked our way of explanation, please look at these courses to enroll: courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899 courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29
After going thru tones of videos I found all three videos are really help full. Just a small feed back while coding you are really quick which shows your perfection but it is not good for a new guy like me. Thanks a lot
Glad you found it helpful, please like and share the video to spread the word :) I am not actually typing quick. I am just saving some time by skipping the complete typing of code. This is done intentionally, otherwise if I shows every statement typing then the video becomes very slow and people may not like it.
Amazing video, Nicely explained . Very well structured code. Now this video helped me, hence it is my primary responsibility to give back to you. I did watch all the Ads that appeared, a tiny gesture. Your efforts behind making 22 mins of video , least we can watch 2 mins of Ads if that helps you in anyway. thank you very much.
It definitely helps, thanks for your nice gesture. If you like our videos, you can also think about enrolling in our courses. Here are few options: learn.letskodeit.com/p/test-automation-bundle/?product_id=1483892&coupon_code=UA-camRS29 learn.letskodeit.com/p/selenium-webdriver-with-java/?product_id=342636&coupon_code=UA-camSELJAVA9
Glad it helped you :) Please help spread the word by liking and sharing the video. If you like our content, you can also enroll in the complete course where POM is already covered. courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
Hi, I have a doubt about the custom logging in extent report in this approach. Kindly help me with it. The ExtentTest object is created in a class (onTestStart method) that implements the ITestListener interface. test.log(STATUS.PASS,"success"); works only in that class. How can this test object be used in other classes where multiple test cases shall exist for custom logging?
In that scenario, we should create a BaseTest Class and then use that. All Test Classes should inherit BaseTest Class. You can take one of our courses, you will learn a lot of details: courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899 Includes 9 Courses, future new test and automation courses will be added to this bundle courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29
Great Video. On TestListeners class you have explicitly got the driver instance from test class , that means if there was 100 test case we will have to define that step 100 times. It would be efficient if there was a base driver class and somehow you could capture that driver instance
@@LetsKodeItOfficial Thanks brother.This is the video i was looking for and it helped me to get clear idea.I need help from you.I have declared browser variable in base class and imported in TestListeners class.But after run in the console it says "'C:\Users\QA\AppData\Local\Temp\screenshot15785966358997876699.png' exists but is not a directory" & image is not attached to the report.Can you help me it would be great.Thanks!
Glad you liked it :) Please look at these options to enroll directly instead of Udemy: courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899 courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29
One question: why do we hardcode the TestClassusingListeners class in TestListeners.java ( Line48). Shouldn't we make it dynamic? We need to use the listener for many different Test classes.
Yes, when we have many test classes then we can create a BaseTest class where driver will be initialized. Then BaseTest class will be used here instead of a specific class and it will work for all the classes.
Let's Kode It .. Hi.. Thanks much for the tutorial. I have a scenario to execute multiple TestClasses using TestNG.xml.As you suggested, I’ve created baseTest class and extended TestListener to the baseTest. Also, i have to attach logs in the report.Hence used extentTest .info (), for every tests in my Test Class. While i am executing the Test suite, i am getting Null Pointer exception at extentTest.info() step. Kindly take session on handling multiple test classes and also to attach logs in the report
Glad you found it helpful, please like and share the video to spread the word :) If you like our videos, you can also think about enrolling in our courses. Please take a look at the course links in the description of the video.
Excellent explanation and clear cut implementation. Kudos to your knowledge. I tried implementing your method but every time a method of TestListener is accessed it's opening a new chrome browser window and taking a blank screenshot in extent report.
@@LetsKodeItOfficial Issue got resolved, issue is with driver that is being accessed, I have extended baseTest class and accessed the driver from there, the issue is gone now. Thanks.
Thank you very helpful. Remade the video too much cut pasting across the classes creating confusion. Please also make a video on Spark Reporter with Listener with customize log for each test cases.
Helpful content and great explanation but as you shown in TestListener class for failure method class name is hardcoded instead how to provide dynamic class name here as while scripting executing it will take running class name and capture the screenshot?
They can easily be replaced with the BaseTestClass because all these things should go to BaseTestClass I recommend you enrolling in our Advanced Framework course, here is the discounted link: courses.letskodeit.com/courses/selenium-webdriver-advanced?coupon=UA-camRS899 You can also explore the Complete Automation Bundle. Link in the description.
I got the screenshot for failed test cases in screenshot folder but it's not showing in the Extent report. I need your help... By the way, You have done great job....Thanks for your valuable information
hey thanks for the great video. one small issue, in case of failed test, the exception is displaying with full details, I do not have option to hide the details, it should be like you are getting, details should be visible only when clicked the see full report.
Hi, The Video was very useful. I do have question, is there any particular reason that you use static method in ExtentManage why didn't use the non static method and create instance of ExtentManager, if possible could you explain me. I really appreciate it. Thank you
We used the static method because we don't want to create a new instance of report for every method. Every test method in the same run will append to the same report.
Your way explanation is good, I have a query. Suppose if there are multiple classes how to take screen shot for all of them, here you are taking one class and provided that class name in screenshot method
In that scenario, we should create a BaseTest Class and then use that. All Test Classes should inherit BaseTest Class. If you want to learn complete framework implementation, I would suggest you to take this course. You are really going to love it. courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
Thanks for the video. I found it really useful. I am using multiple test classes and all these classes extends a base class. But the driver initialization is done in a different class- Driverfactory and am calling the method from the class Driverfactory in base class. So if i give base class name in listener then will it get the driver instance since i haven't declared any driver instance in base class. Please advice.
Yes, it will work. Your DriverFactory probably has the methods to initialize the driver but they are initialized in the BaseTestClass when you call that method. BaseTestClass has the driver instance and if you use that in TestListeners then it will work.
Dinu Vijayan, can you please explain me how did you do that. My driver is also in a different class, and i could not do it. It did not work for me. Thank you
@@ravshanbekyusupov4582 simply where we initialize driver you should insert that class, simply in which class you use @beforeMethod use that class name
Hello, I have a question, in the first test you were able to use test log to put information in the @Test methods that was visible in the Report, how can you achieve the same with the Test Listeners?
I Have tried this one it gave me the best result as expected. Thanks for crystal clear explanation. How can we add screenshots to the logs for passed & fail. Can u help me with that. Pls.
Hi Sir.. Thanks for the excellent content provided. I have a requirement of attaching screenshot for every page that we navigate through our test case and need to attach to extent report... How to do this.. pls let me know.. its bit urgent. Currently we are taking screenshot for only failures.
I gone through the video and preared code but getting issues in extentTest.get().fail("" +. 1.how will implemented in frame work for multiple test suite insted of hard code class name in the code and MediaEntityBuilder class not provided. please suggests.and send to my email ..
First of all thanks for your videos, lot of new information you have provided in your videos but I want to implement the same with POM and want to generate reports for multiple classes. Please make a video on POM with extent report.
Glad it helped you :) Please help spread the word by liking and sharing the video. If you like our content, you can also enroll in the complete course where POM is already covered. courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
@@ಸಂಜೆಸುದ್ದಿ No, when we have a framework we usually create a BaseTestClass which is inherited by all the Test Classes. We have all these details covered in this course: courses.letskodeit.com/courses/selenium-webdriver-advanced?coupon=Direct1099 You can also enroll in the complete test automation bundle to get access to all the courses: courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29
Can you please show a demo on how we can integrate Extent report with logging information as well? For ex..this report only shows the TC as passed or failed with screenshot. What i am asking is the complete logging information in Report with proper steps like 1) URL entered 2) Login credentials entered 3) User landed onto the home page..
We should no do that, reporting is for high level management stuff. Logging is for engineers -> technical reasons, debugging, etc. Always keep them separate.
@@LetsKodeItOfficial But our department was asked to enter the logs specifying the reason for failure. Attach screenshot. Specify the test description for each test case in the report.
Hi sir Superb sir, but on test passed and failed how test-data will be displayed sir For example we provided name: somexxxxx but if that test failed we just able to see only exception but how test data for failures was displayed sir please give syntax for that sir
Hello, thank you for this tutorial. I did everything step by step but the screenshoot was generated in report only first time. Every next execution there is no png file in report. Do you use any specific libs in pom file?
I think my case is more complicated. When I’m using „MediaEntityBuilder.createScreenCaptureFromPath(„screenshots/”).build()); - working but I don’t wanted to have png file hardcoded and I need this to be taken aften the file is executed(generated) dynamically. The code „MediaEntityBuilder.createScreenCaptureFromPath(path).build()); - is not working. I have in pom.xml: - testng 6.14.3, - selenium-java 3.141.59, - extentreports 4.1.2 (tried already with 4.0.0, 3.1.5, 3.0.0), - ashot 1.5.4, - extentreports-testng-adapter 1.0.7 Additionally I have the „com.aventstack.extentreports.reporter.ExtentHtmlReporter” is deprecated info message. If anyone can help I will be gratefull.
Hi, When we have multiple Test Classes, then we create a BaseTestClass and all Test Classes should inherit from BaseTestClass. TestListener Class will use BaseTestClass for driver instance.
This is also shown in the lectures. If you are asking about every step, then that needs to go in Test Methods and it should not be done as I have already explained in the videos.
Glad you found it helpful :) If you like our way of teaching, please consider taking full course on our website. You can find the discounted links in the video description.
You should not be using Extent Reports in Test Methods. That is not helpful, it will make your report bulky and we don't usually use Extent Reports for debugging. This is why we don't need a lot of details in them. They should only be used from management and showing status to other teams only.
Thankyou for the video but if we have multiple test Class then how we WebDriver driver=((TestClassUsingListners)result.getInstance()).driver; like LoginPageTestCase, SignupTestCase, HomePageTestCase @Override public void onTestFailure(ITestResult result) { String exceptionMessage = Arrays.toString(result.getThrowable().getStackTrace()); extentTest.get().fail("" + "Exception Occured, click to see details:" + "" + exceptionMessage.replaceAll(",", "")+" "); ->>>>>WebDriver driver=((TestClassUsingListners)result.getInstance()).driver; String path=takeScreenshot(driver,result.getMethod().getMethodName()); try { extentTest.get().fail(""+"Screenshot of failure"+"",MediaEntityBuilder.createScreenCaptureFromPath(path).build()); } catch (Exception e) { extentTest.get().fail("Test failed, cannot attach screenshot"); } String logText = "Test Method " + result.getMethod().getMethodName() + " Failed"; Markup markup = MarkupHelper.createLabel(logText, ExtentColor.RED); extentTest.get().log(Status.FAIL, markup); }
When we have multiple classes, we implement a BaseTestClass and then use it, instead of using individual classes. You can enroll in this advanced framework level course to learn framework integration: courses.letskodeit.com/courses/selenium-webdriver-advanced?coupon=Direct1099
Test steps should not be logged to Extent Report. I have explained in this series. You should watch the other two lectures of Extent Reports before this one.
Hi, There is no need to implement XML Reports. Default reports are already available from TestNG. Now a days, we are moving towards more advanced reports like Extent Reports.
@@LetsKodeItOfficial Ok Thanks will drop you mail for that. I also need your help in implementing logging in POM and with Listeners. Can you share code for that also. I will be so thankful to you.
@@LetsKodeItOfficial Thanks . one question here as per the video we are importing "TestclassUsingListeners" java class file to TestListeners java class file . If we have another java class for which we need to extend the this implementation then how we need to passing driver reference for the new java class to TestListeners java file ? My email id ravi14.nelluri@gmail.com
@@LetsKodeItOfficial I am getting NullPointerException at "ExtentTest test = extent.createTest(result.getTestClass().getTestName() + " :: " + result.getMethod().getMethodName());" while running the script ? any clue ?
@@ravi_nelluri In that scenario, we need to implement a BaseTest Class where driver initialization will be done and all the test classes will inherit from BaseTest Class. TestListeners Class will get driver instance from BaseTest Class. You can try to explore this course, it covers framework in a lot of detail: learn.letskodeit.com/p/selenium-webdriver-advanced-framework/?coupon_code=95OFF
Hi Anil, thanks for your efforts & passion in creating these videos. I liked your explanation, it's so clear and always focusing on the problem statement which made your videos look so interesting. ExtentHtmlReporter is now deprecated, do we have anything alternative for this? Would you mind emailing this code to my email address? thanks, Manikanth Kolla
Thanks for the amazing content. I need your help in implementing logging in POM and with Listeners. Please send the code on my mail which I have sent you....Or make a video on that.
@@LetsKodeItOfficial Hi I have followed the exact way.. After running testng.xml 'reports' folder is created but the report is not getting generate can you please help.
@@LetsKodeItOfficial thanks for the reply I found the mistake now its working as expected..Thank you so much. Keep posting new content it really helps ❤. Please make video on mock data generator and how to implement webdriver and selenium methods in generic way..❤❤
@@aniketdeokar559 You can actually enroll in our complete course where I discussed complete Selenium WebDriver Framework with generic methods and data driven testing. Here is the link if you are interested: courses.letskodeit.com/courses/selenium-webdriver-advanced?coupon=GITCODE899
I have gone through all the 3 videos and implemented. Superb Explanation.
Glad you liked it :)
Please help by liking and sharing the video.
Your explaination is quite amazing, I have gone through tons of other videos in youtube but it was quite helpful. You've mastered the art of teaching without any though i've enrolled in course.Thanks a lot
Glad you found the videos helpful :)
Thankyou for explaining. I had tried to get the extent report and it worked in a single execution 😊. Both positive and negative scenarios are working
Glad you liked it :)
If you liked our way of explanation, please look at these courses to enroll:
courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29
After going thru tones of videos I found all three videos are really help full. Just a small feed back while coding you are really quick which shows your perfection but it is not good for a new guy like me. Thanks a lot
Glad you found it helpful, please like and share the video to spread the word :)
I am not actually typing quick. I am just saving some time by skipping the complete typing of code. This is done intentionally, otherwise if I shows every statement typing then the video becomes very slow and people may not like it.
This is the best videio. I get my solution. Thank you😊
Glad you liked it :)
Please help by liking and sharing the video.
Amazing video, Nicely explained .
Very well structured code.
Now this video helped me, hence it is my primary responsibility to give back to you.
I did watch all the Ads that appeared, a tiny gesture. Your efforts behind making 22 mins of video , least we can watch 2 mins of Ads if that helps you in anyway. thank you very much.
It definitely helps, thanks for your nice gesture. If you like our videos, you can also think about enrolling in our courses. Here are few options:
learn.letskodeit.com/p/test-automation-bundle/?product_id=1483892&coupon_code=UA-camRS29
learn.letskodeit.com/p/selenium-webdriver-with-java/?product_id=342636&coupon_code=UA-camSELJAVA9
Great work, Great video...…..thanks a lot !
Glad you found it helpful :)
Please like and share the video and help us spread the word.
Thanks a lot for detailed explanation.
Glad it helped you :)
Please help spread the word by liking and sharing the video.
If you like our content, you can also enroll in the complete course where POM is already covered.
courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
Lovely explanation .Thank you .Was really helpful .I am going to try it for sure.
Glad you found it helpful, please like and share the video to spread the word :)
Hi, I have a doubt about the custom logging in extent report in this approach. Kindly help me with it.
The ExtentTest object is created in a class (onTestStart method) that implements the ITestListener interface.
test.log(STATUS.PASS,"success"); works only in that class.
How can this test object be used in other classes where multiple test cases shall exist for custom logging?
In that scenario, we should create a BaseTest Class and then use that.
All Test Classes should inherit BaseTest Class.
You can take one of our courses, you will learn a lot of details:
courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
Includes 9 Courses, future new test and automation courses will be added to this bundle
courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29
Extend the listener to the java class where u need and call the method to print the log in report. Hope u will get this
Great Video. On TestListeners class you have explicitly got the driver instance from test class , that means if there was 100 test case we will have to define that step 100 times. It would be efficient if there was a base driver class and somehow you could capture that driver instance
This is exactly how it is done when we have framework. There is a BaseTest Class which should be used.
@@LetsKodeItOfficial Thanks brother.This is the video i was looking for and it helped me to get clear idea.I need help from you.I have declared browser variable in base class and imported in TestListeners class.But after run in the console it says
"'C:\Users\QA\AppData\Local\Temp\screenshot15785966358997876699.png' exists but is not a directory" & image is not attached to the report.Can you help me it would be great.Thanks!
@@mohamedilyas8610 There might be some issues with the path. I would suggest you to use your own custom path instead of using something from AppData.
Explained in a Excellent way.
Really impressive :-)
Definitely, I'm going to buy the course from UDEMY as well.
Glad you liked it :)
Please look at these options to enroll directly instead of Udemy:
courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29
One question:
why do we hardcode the TestClassusingListeners class in TestListeners.java ( Line48). Shouldn't we make it dynamic? We need to use the listener for many different Test classes.
Yes, when we have many test classes then we can create a BaseTest class where driver will be initialized. Then BaseTest class will be used here instead of a specific class and it will work for all the classes.
Super... thank you for quick response. Appreciate it.
Let's Kode It .. Hi.. Thanks much for the tutorial. I have a scenario to execute multiple TestClasses using TestNG.xml.As you suggested, I’ve created baseTest class and extended TestListener to the baseTest. Also, i have to attach logs in the report.Hence used extentTest .info (), for every tests in my Test Class. While i am executing the Test suite, i am getting Null Pointer exception at extentTest.info() step. Kindly take session on handling multiple test classes and also to attach logs in the report
Nice explanation sir. I like it really helped me lot.
Glad you found it helpful, please like and share the video to spread the word :)
If you like our videos, you can also think about enrolling in our courses. Please take a look at the course links in the description of the video.
Excellent explanation and clear cut implementation. Kudos to your knowledge. I tried implementing your method but every time a method of TestListener is accessed it's opening a new chrome browser window and taking a blank screenshot in extent report.
Glad it helped you :)
Please help spread the word by liking and sharing the video.
Send an email at letskodeit@gmail.com and I will send you the code files implemented in this video.
@@LetsKodeItOfficial Issue got resolved, issue is with driver that is being accessed, I have extended baseTest class and accessed the driver from there, the issue is gone now. Thanks.
@@PraveenLingam-k4q Glad you were able to figure it out :)
Hi Sir, i want to add the logs for extent reports but now it is giving me an error of java null exception. plz help me with that
Please send an email at letskodeit@gmail.com with details of the issue you are seeing.
What is the difference between com.aventstack and com.relevantcodes dependencies of Extent Reports?
They are both used in different versions.
com.relevantcodes -> This is used in version 2
com.aventstack -> This is used in version 4
am trying to get screen shot attached to extent report. but not able to get the screen shot . Any help please. Am using extent aventstack package.
You can reach out at letskodeit@gmail.com and I will send you the code I used.
Thanks for the content..You explained it very well and in detail.. Thanks again ❤
Glad you found it helpful, please like and share the video to spread the word :)
Thank you very helpful.
Remade the video too much cut pasting across the classes creating confusion.
Please also make a video on Spark Reporter with Listener with customize log for each test cases.
Glad you found the videos helpful :)
Superb man!!!!, Thanks for this !
Glad you liked it :)
Please help by liking and sharing the video.
Helpful content and great explanation but as you shown in TestListener class for failure method class name is hardcoded instead how to provide dynamic class name here as while scripting executing it will take running class name and capture the screenshot?
They can easily be replaced with the BaseTestClass because all these things should go to BaseTestClass
I recommend you enrolling in our Advanced Framework course, here is the discounted link: courses.letskodeit.com/courses/selenium-webdriver-advanced?coupon=UA-camRS899
You can also explore the Complete Automation Bundle. Link in the description.
Thanks for the video. But Actually the report is not displaying the method name,so its kind of confusing which method passed/failed ect !!
Report actually shows the method name, can you please explain what's the confusion?
I got the screenshot for failed test cases in screenshot folder but it's not showing in the Extent report. I need your help...
By the way, You have done great job....Thanks for your valuable information
Glad you liked it :)
Please help by liking and sharing the video.
Can we create suite wise graphical representation of testcases in this extent report? If yes then how ?
That's exactly what is shown in the video.
Did you mean something else by Test Suite?
hey thanks for the great video. one small issue, in case of failed test, the exception is displaying with full details, I do not have option to hide the details, it should be like you are getting, details should be visible only when clicked the see full report.
Please double check the code with what I showed.
Send an email at letskodeit@gmail.com and I will send you the code files.
@@LetsKodeItOfficial sent you, please check.
Hi, The Video was very useful. I do have question, is there any particular reason that you use static method in ExtentManage why didn't use the non static method and create instance of ExtentManager, if possible could you explain me. I really appreciate it. Thank you
Glad you found it helpful :)
Please like and share the video and help us spread the word.
We used the static method because we don't want to create a new instance of report for every method. Every test method in the same run will append to the same report.
@@LetsKodeItOfficial Thank you
Your way explanation is good,
I have a query. Suppose if there are multiple classes how to take screen shot for all of them, here you are taking one class and provided that class name in screenshot method
In that scenario, we should create a BaseTest Class and then use that.
All Test Classes should inherit BaseTest Class.
If you want to learn complete framework implementation, I would suggest you to take this course. You are really going to love it.
courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
Thanks for the video. I found it really useful. I am using multiple test classes and all these classes extends a base class. But the driver initialization is done in a different class- Driverfactory and am calling the method from the class Driverfactory in base class. So if i give base class name in listener then will it get the driver instance since i haven't declared any driver instance in base class. Please advice.
Yes, it will work. Your DriverFactory probably has the methods to initialize the driver but they are initialized in the BaseTestClass when you call that method. BaseTestClass has the driver instance and if you use that in TestListeners then it will work.
@@LetsKodeItOfficial Thanks.. It worked :)
Dinu Vijayan, can you please explain me how did you do that. My driver is also in a different class, and i could not do it. It did not work for me. Thank you
@@ravshanbekyusupov4582 simply where we initialize driver you should insert that class, simply in which class you use @beforeMethod use that class name
Thanks for this amazing tutorial
Glad you liked it :)
Please help by liking and sharing the video.
Hello,
I have a question, in the first test you were able to use test log to put information in the @Test methods that was visible in the Report, how can you achieve the same with the Test Listeners?
The intention is not to use that in @Test methods, this is what I have explained in the video also.
I Have tried this one it gave me the best result as expected. Thanks for crystal clear explanation. How can we add screenshots to the logs for passed & fail. Can u help me with that. Pls.
Glad you found it helpful :)
Please like and share the video and help us spread the word.
Please follow this video for attaching screenshots:
ua-cam.com/video/Iden9bb6H8g/v-deo.html&lc=
Hi Sir.. Thanks for the excellent content provided. I have a requirement of attaching screenshot for every page that we navigate through our test case and need to attach to extent report... How to do this.. pls let me know.. its bit urgent.
Currently we are taking screenshot for only failures.
Hi Santhosh,
You can take screenshot on success also, copy the same code in success method.
@@LetsKodeItOfficial Thank you sir.
I gone through the video and preared code but getting issues in extentTest.get().fail("" +.
1.how will implemented in frame work for multiple test suite insted of hard code class name in the code and MediaEntityBuilder class not provided.
please suggests.and send to my email ..
When there are multiple classes, then we use BaseTestClass instead of individual class names.
Hi, could you please share how did you fix your error on extentTest.get().fail?
@@rahultaralekar541 There is no error there, I have sent you the code also. Please go through it.
Hello, thanks for this tutorial. But why timeline cannot active ? In this video, Your timeline no active, How you can fix it?
Glad you liked the video :)
Please share the video with your friends to help us.
Please let me know which timeline you are referring to.
First of all thanks for your videos, lot of new information you have provided in your videos but I want to implement the same with POM and want to generate reports for multiple classes. Please make a video on POM with extent report.
Glad it helped you :)
Please help spread the word by liking and sharing the video.
If you like our content, you can also enroll in the complete course where POM is already covered.
courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
Hi I was able to implement it after seeing this video but how can we do this for more than one test page.??
Same code, you only need to change the name of the Test Class. You need to use BaseTest Class when you have more than one Test Class.
Let's Kode It
Hi thanks for the reply you mean to say we have to create a generic method for that ??
@@ಸಂಜೆಸುದ್ದಿ No, when we have a framework we usually create a BaseTestClass which is inherited by all the Test Classes.
We have all these details covered in this course:
courses.letskodeit.com/courses/selenium-webdriver-advanced?coupon=Direct1099
You can also enroll in the complete test automation bundle to get access to all the courses:
courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29
Let's Kode It
Thank you I will chk the course details and register 🙂
Can you please show a demo on how we can integrate Extent report with logging information as well? For ex..this report only shows the TC as passed or failed with screenshot. What i am asking is the complete logging information in Report with proper steps like 1) URL entered 2) Login credentials entered 3) User landed onto the home page..
We should no do that, reporting is for high level management stuff. Logging is for engineers -> technical reasons, debugging, etc.
Always keep them separate.
@@LetsKodeItOfficial Thanks for reverting 👍
@@LetsKodeItOfficial But our department was asked to enter the logs specifying the reason for failure. Attach screenshot. Specify the test description for each test case in the report.
Hi sir Superb sir, but on test passed and failed how test-data will be displayed sir For example we provided name: somexxxxx but if that test failed we just able to see only exception but how test data for failures was displayed sir please give syntax for that sir
Sorry, I didn't understand your example "For example we provided name: somexxxxx".
Which test data you want to display?
Hello, thank you for this tutorial. I did everything step by step but the screenshoot was generated in report only first time. Every next execution there is no png file in report. Do you use any specific libs in pom file?
Hi,
I used libs which are shown in the video series. No other libs are used.
Send an email at letskodeit@gmail.com and I will send you the code files.
done :)
@@kazuhirohagi7094 I have sent you the code files.
@Let's Kode It Thank you
I think my case is more complicated. When I’m using „MediaEntityBuilder.createScreenCaptureFromPath(„screenshots/”).build()); - working but I don’t wanted to have png file hardcoded and I need this to be taken aften the file is executed(generated) dynamically. The code „MediaEntityBuilder.createScreenCaptureFromPath(path).build()); - is not working.
I have in pom.xml: - testng 6.14.3, - selenium-java 3.141.59, - extentreports 4.1.2 (tried already with 4.0.0, 3.1.5, 3.0.0), - ashot 1.5.4, - extentreports-testng-adapter 1.0.7
Additionally I have the „com.aventstack.extentreports.reporter.ExtentHtmlReporter” is deprecated info message.
If anyone can help I will be gratefull.
If i have a lot of test suites how can I share the instance of driver for all those ones?
Hi,
When we have multiple Test Classes, then we create a BaseTestClass and all Test Classes should inherit from BaseTestClass.
TestListener Class will use BaseTestClass for driver instance.
Thanks for such a nice tutorial. I have one question, how we can use test.log to print logs in report using listeners.
This is also shown in the lectures. If you are asking about every step, then that needs to go in Test Methods and it should not be done as I have already explained in the videos.
Do u use any wrapper class for predefined methods?
@djdj
you must make more of such videos on each topic.
Glad you found it helpful :)
If you like our way of teaching, please consider taking full course on our website. You can find the discounted links in the video description.
Where can we download the code sir?
Send an email at letskodeit@gmail.com for code
How to add categories to report..?
You can do extentTest.assignCategory("Category Name");
Great video couple comments.
The second video does not work .
Also - can you record a video on using methods in POM with Extent Report?
Thank you
Can you please explain what you meant by "second video doesn't work"?
Haven't heard this from anyone else.
We can replace ExtentHtmlReporter with ExtentSparkReporter as ExtentHtmlReporter is deprecated from V4.1.3
Thanks for sharing the details :)
it's more helpful
Glad you liked it :)
Please help by liking and sharing the video.
@@LetsKodeItOfficial it's working fine, it's more helpful.
Thanks for the Extent report videos.
If I want to use extent report in my test methods then how should i do that?
You should not be using Extent Reports in Test Methods. That is not helpful, it will make your report bulky and we don't usually use Extent Reports for debugging. This is why we don't need a lot of details in them. They should only be used from management and showing status to other teams only.
@@LetsKodeItOfficial okay..Thanks for the explaination
@@LetsKodeItOfficial how and where would you suggest to store all the logs from the Test Methods?
@@TheAllanazarpour Logs should be saved in log files generated by Log4j2.
is it on github ?
Not yet on GitHub.
You can email at letskodeit@gmail.com for code.
How to add screenshots in an XML report?
That would a different topic. Extent Reports are HTML Reports, Extent Reports are not XML Reports.
Thankyou for the video but if we have multiple test Class then how we WebDriver driver=((TestClassUsingListners)result.getInstance()).driver;
like LoginPageTestCase, SignupTestCase, HomePageTestCase
@Override
public void onTestFailure(ITestResult result) {
String exceptionMessage = Arrays.toString(result.getThrowable().getStackTrace());
extentTest.get().fail("" + "Exception Occured, click to see details:"
+ "" + exceptionMessage.replaceAll(",", "")+"
");
->>>>>WebDriver driver=((TestClassUsingListners)result.getInstance()).driver;
String path=takeScreenshot(driver,result.getMethod().getMethodName());
try {
extentTest.get().fail(""+"Screenshot of failure"+"",MediaEntityBuilder.createScreenCaptureFromPath(path).build());
} catch (Exception e) {
extentTest.get().fail("Test failed, cannot attach screenshot");
}
String logText = "Test Method " + result.getMethod().getMethodName() + " Failed";
Markup markup = MarkupHelper.createLabel(logText, ExtentColor.RED);
extentTest.get().log(Status.FAIL, markup);
}
When we have multiple classes, we implement a BaseTestClass and then use it, instead of using individual classes.
You can enroll in this advanced framework level course to learn framework integration:
courses.letskodeit.com/courses/selenium-webdriver-advanced?coupon=Direct1099
Can you please cover a topic called log4j implementation.
It's covered in the course.
courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899
How to add test step logs to extent report
Test steps should not be logged to Extent Report. I have explained in this series. You should watch the other two lectures of Extent Reports before this one.
@@LetsKodeItOfficial Thanks for the quick reply
Hi Great explanation could you share same with your git repository? Thanks
Glad you liked it :)
Please help by liking and sharing the video.
Send an email at letskodeit@gmail.com and will provide you the code.
How to implement an XML Report?
Hi,
There is no need to implement XML Reports. Default reports are already available from TestNG.
Now a days, we are moving towards more advanced reports like Extent Reports.
Hi! Can you share the code ?
Sure, please email at letskodeit@gmail.com
Can u please share these Extend Reports code
You can reach out at letskodeit@gmail.com
Superb explanation. Can you share the code
Please send an email at letskodeit@gmail.com, will send you the code.
It will be great if you can like and share the video with your friends.
Please help to share videos about Database testing
Thanks for the suggestion. We will keep this in mind.
can you upload the files here...
There is no way to upload files on UA-cam.
Please send an email at letskodeit@gmail.com
@@LetsKodeItOfficial Ok Thanks will drop you mail for that.
I also need your help in implementing logging in POM and with Listeners. Can you share code for that also. I will be so thankful to you.
Hi i have sent you mail. Please suggest
@@amitdhankar6432 I will provide the code for this.
@@amitdhankar6432 Replied there.
Can we get the code for download ?
Let me know your email and I will send it to you. In future, I will create a GitHub repo for UA-cam videos.
@@LetsKodeItOfficial Thanks . one question here as per the video we are importing "TestclassUsingListeners" java class file to TestListeners java class file . If we have another java class for which we need to extend the this implementation then how we need to passing driver reference for the new java class to TestListeners java file ? My email id ravi14.nelluri@gmail.com
@@LetsKodeItOfficial I am getting NullPointerException at "ExtentTest test = extent.createTest(result.getTestClass().getTestName() + " :: " +
result.getMethod().getMethodName());" while running the script ? any clue ?
@@ravi_nelluri In that scenario, we need to implement a BaseTest Class where driver initialization will be done and all the test classes will inherit from BaseTest Class. TestListeners Class will get driver instance from BaseTest Class.
You can try to explore this course, it covers framework in a lot of detail:
learn.letskodeit.com/p/selenium-webdriver-advanced-framework/?coupon_code=95OFF
@@ravi_nelluri I have sent you the code files. Please double check your code with them line by line.
Hi Anil,
thanks for your efforts & passion in creating these videos. I liked your explanation, it's so clear and always focusing on the problem statement which made your videos look so interesting.
ExtentHtmlReporter is now deprecated, do we have anything alternative for this?
Would you mind emailing this code to my email address?
thanks,
Manikanth Kolla
You can replace it with ExtentSparkReporter.
You can email me at letskodeit@gmail.com for the complete code.
can you also do this with cucumber??
Sure, will think about making a video on Cucumber also.
Thanks for the amazing content. I need your help in implementing logging in POM and with Listeners. Please send the code on my mail which I have sent you....Or make a video on that.
I have already replied to you on email.
@@LetsKodeItOfficial Hi I have followed the exact way.. After running testng.xml 'reports' folder is created but the report is not getting generate can you please help.
@@aniketdeokar559 Please send an email at letskodeit@gmai.com and I will send you the code files discussed in the video.
@@LetsKodeItOfficial thanks for the reply I found the mistake now its working as expected..Thank you so much. Keep posting new content it really helps ❤. Please make video on mock data generator and how to implement webdriver and selenium methods in generic way..❤❤
@@aniketdeokar559 You can actually enroll in our complete course where I discussed complete Selenium WebDriver Framework with generic methods and data driven testing. Here is the link if you are interested:
courses.letskodeit.com/courses/selenium-webdriver-advanced?coupon=GITCODE899