I've never seen anyone explaining in this way. Your way of creating the framework from scratch and putting each and everything at right place-> AWESOME, Amuthan. We are so lucky to have a talent like you. Thank you so much for all these tutorials.
This literally just fixed all my reports and integrated my listener for work. You sir are a legend, thank you so much for this series of videos. It truly helped me out, do you have a Patreon account? If not you should look into it, I am sure you are helping a LOT of people.
Thank you so much Amuthan...it was just like a piece of cake with your explanation......optimising the code wherever necessary...clean way of writing code. Anyone can write code as such...but writing it precisely........wow Many thanks to you.
Hi amuthan, how do you remember the steps to create this framework? This is such a vast framework with so many optimisation. I can create the framework when I am watching this series but I should be able to do so without referring the videos like you are doing. You can build the framework without referring to any code or videos. When I am doing it, I forget the steps on what is done as part of the framework and then I have to look into the videos again to remember how it is done. Please suggest how to improve this??
I love the fact that you build something with so much passion and then break it by saying "I dont like it"... to again enhance... Man, when is it going to stop !!! :-D
Amuthan, Thanks for sharing the knowledge and videos are very helpful. One query : Tests are now running via TestNG.xml using listneres but since initReports() for Extent is now not present in BaseTest class(before Suite), it will never be called while running independent test class. Any way to handle this so that report gets generated by running test case independently or via TestNG.
Hi Monika, Glad my videos are helpful. I have made an extensive playlist of extent reports. You can also have a look at it. Welcome aboard and have an exciting learning journey:)
Nice videos Amuthan. One doubt- is it recommended to pass 3-4 arguments in a method like sendkeys or click(as you are passing locator,wait strategy, value, and now element name)?
Yes Abhi. It is alright to pass three parameters to the send keys method. All three of them have their own role. Instead of writing multiple line to handle wait, then to click, then to write in logs this should be better approach.
Hi, Amutan. I have one doubt, In Driver class you have used unload() after DriverManager.getDriver().quit();similarly where are we using ExtentManager.unload()?
Great videos Amuthan, really liked your videos and subscribed your channel :) Also could you please tell me- How can I change names of "Tests with data provider annotations" in the extent reports? All the tests using the same data provider shows the same test names in the extent reports.
Hi Amol., Welcome aboard and I am glad you liked the content. Ha ha, whatever you have asked is a very good requirement. There are multiple ways to achieve this. 1. You can try to use IDataProvider Listener to customise. 2. If you want to append values from the test iteration data to test description then you can watch part 30 and 31 of the selenium framework playlist. 3. Please wait for sometime, i will also include a video about this.
Hi Amuthan, You created listeners package in src/main/java but how are you able to find the testng library in main package. Did you add the testng libraries manually apart from using in the pom.xml
Amuthan, in src/main/java I have created the package for listeners and then class just like you did but I am not getting the ITestListener and ISuiteListener Interface to implement in the Listener class what can be the reason?
From testng 7.0 version, those methods are made to be default. So you have to type yourself or copy paste the default methods from itestlistener, isuitelistener
Amuthan, Somehow after moving the content from ExtentManager to ExtentLogger, and running the testng.xml, I am now having 4 tests running instead of 2, and out of those 4 tests, one test is not having logs, and the other test is having its logs(as you discussed in the previous video by telling the ThreadLocal implementation). I have debugged from my side - Replicated the ThreadLocal implementation as you do - Checked the chrome driver version, Even changed it Still having the same issue. Can you guess where the issue is?
Amuthan, Thanks for sharing the knowledge and videos are very helpful. One Doubt: If the method is failing , how we have to handle with ExtentLogger ? means either it pass or fail with a single line of code how can we handle?
Hi Amuthan this is an excellent content I've one query, so we are using the Listeners for test case executions status but in the test page, the user can access the methods from ExtentReport, example initReports(), flushReports() can we restrict that by inherting the ExtendReport in TestListners class by giving the protected access in ExtentReport, is this the good approach? like below public class ExtentReport { //but we can't make the ExtentReport as final protected static void initReports() //protected access { if(Objects.isNull(extentReports)) { extentReports = new ExtentReports(); ExtentSparkReporter spark = new ExtentSparkReporter(FrameworkConstants.getReportPath()); extentReports.attachReporter(spark); } }}
public class TestListener extends ExtentReport implements ITestListener { public void onTestStart(ITestResult result) { //code to handle the report } } But if one extends the ExtentReport class, they can access the methods in ExtentReport class(initReports(),flushReports(),createTest() ) How we can I restrict that or what is the better approach ? And can I move the testListener class to Report class? //to get default access from the package
You should only inherit if there is proper IS A relationship. Dog can extend Animal because Dog is An Animal But TestListener is Not A Extent report. Code reusability is not a priority
I am trying to implement the listeners but every time I run the tests after implementing them it returns tests ignored and just keep spinning without executions
@@TestingMiniBytes How to check that? Also, on adding external testNg jars, issue is resolved but its picking testng from other location. Instead of .m2 repository, its picking it up from .p2 repo.
When i run more than 10 test cases in parallel, I am getting wrong Extent report because, Execution show Test A got fail but in report is show Test B fail with A's screenshot result mismatch can you please guide how to solve this
How to use Listeners in Junit My project is not using Testng and need to write extent report whenever tests fails along with pass tests too. Its simple junit groovy project .
Hi Amuthan, is there any way to convert this extent HTML report into a pdf file format. please suggest any solution for this. for cucumber extent to pdf, I saw about this "github.com/grasshopper7/extentreports-cucumber6-adapter". same like for our framework is it possible?
Thats a cucumber plugin to convert cucumber results to pdf. There is no direct way to achieve. But you can try openhtmltopdf, apache fop can convert xml to pdf or wkhtmltopdf libraries to cater your needs.
@@TestingMiniBytes thanks amuthan bro for quick reply. Let me check that above mentioned things... It also nice you make video on this topics... It will be more helpful to understand deeply and for others also who are all looking for same queries.
I've never seen anyone explaining in this way.
Your way of creating the framework from scratch and putting each and everything at right place->
AWESOME, Amuthan.
We are so lucky to have a talent like you.
Thank you so much for all these tutorials.
This is some real good tutorial! Crips and to the point.
This literally just fixed all my reports and integrated my listener for work. You sir are a legend, thank you so much for this series of videos. It truly helped me out, do you have a Patreon account? If not you should look into it, I am sure you are helping a LOT of people.
Splendid explanation! This is definitely the go to video for Extent reports.
Amuthan sir, You are a living legend !!
Thank you so much Amuthan...it was just like a piece of cake with your explanation......optimising the code wherever necessary...clean way of writing code.
Anyone can write code as such...but writing it precisely........wow
Many thanks to you.
Glad you liked the content. Keep watching and keep learning. 👍
Excellent teaching. Thank You Amuthan
Kept it simple and packed with information. Good job.
Thanks a lot for your feedback :)
8:14 this is super cool
Hi amuthan, how do you remember the steps to create this framework? This is such a vast framework with so many optimisation. I can create the framework when I am watching this series but I should be able to do so without referring the videos like you are doing. You can build the framework without referring to any code or videos. When I am doing it, I forget the steps on what is done as part of the framework and then I have to look into the videos again to remember how it is done. Please suggest how to improve this??
You will slowly reach there
I love the fact that you build something with so much passion and then break it by saying "I dont like it"... to again enhance... Man, when is it going to stop !!! :-D
It will keep coming. You have many more videos ahead. Enjoy your learning 😄
19:49 report will be very big if we insert each actions in reports if we have many field? Is there a way to avoid?
You can maintain log levels and filter accordingly.
Amuthan, Thanks for sharing the knowledge and videos are very helpful.
One query : Tests are now running via TestNG.xml using listneres but since initReports() for Extent is now not present in BaseTest class(before Suite), it will never be called while running independent test class. Any way to handle this so that report gets generated by running test case independently or via TestNG.
Though there are ways. But a good framework should have only one entry point.
right now I m working on the extent report part and your videos helped a lot thanks. please attach the code
Hi Monika,
Glad my videos are helpful. I have made an extensive playlist of extent reports. You can also have a look at it.
Welcome aboard and have an exciting learning journey:)
Nice videos Amuthan.
One doubt- is it recommended to pass 3-4 arguments in a method like sendkeys or click(as you are passing locator,wait strategy, value, and now element name)?
Yes Abhi. It is alright to pass three parameters to the send keys method. All three of them have their own role. Instead of writing multiple line to handle wait, then to click, then to write in logs this should be better approach.
Hi, Amutan. I have one doubt, In Driver class you have used unload() after DriverManager.getDriver().quit();similarly where are we using ExtentManager.unload()?
Great videos Amuthan, really liked your videos and subscribed your channel :)
Also could you please tell me-
How can I change names of "Tests with data provider annotations" in the extent reports? All the tests using the same data provider shows the same test names in the extent reports.
Hi Amol.,
Welcome aboard and I am glad you liked the content.
Ha ha, whatever you have asked is a very good requirement. There are multiple ways to achieve this.
1. You can try to use IDataProvider Listener to customise.
2. If you want to append values from the test iteration data to test description then you can watch part 30 and 31 of the selenium framework playlist.
3. Please wait for sometime, i will also include a video about this.
@@TestingMiniBytesokay i will try to do that. Thank you🙂
Hi Amuthan, You created listeners package in src/main/java but how are you able to find the testng library in main package. Did you add the testng libraries manually apart from using in the pom.xml
By default in maven testng dependency test will be there if you remove this, we will be able to add testng dependency in src/main/java as well.
Amuthan, in src/main/java I have created the package for listeners and then class just like you did
but I am not getting the ITestListener and ISuiteListener Interface to implement in the Listener class what can be the reason?
From testng 7.0 version, those methods are made to be default. So you have to type yourself or copy paste the default methods from itestlistener, isuitelistener
@@TestingMiniBytes Resolved but now instead of 2, 4 times it is exectuing?
Hey, Can you send me the link of Listener video
Amuthan, Somehow after moving the content from ExtentManager to ExtentLogger, and running the testng.xml, I am now having 4 tests running instead of 2, and out of those 4 tests, one test is not having logs, and the other test is having its logs(as you discussed in the previous video by telling the ThreadLocal implementation). I have debugged from my side
- Replicated the ThreadLocal implementation as you do
- Checked the chrome driver version, Even changed it
Still having the same issue. Can you guess where the issue is?
Please reach out to me in my telegram group
@@TestingMiniBytes what is the telegram group name? How shall I get added into that group?
@@lka5968 t.me/joinchat/cJX1FmzfntJhMTg9
@@TestingMiniBytes joined, thanks
My extent report is opening in IE by default, what settings do i need to change to open the extent report in chrome browser? please suggest.
It will open in the default browser in the system. If you want to open it chrome, set chrome as your default browser in your machine.
@@TestingMiniBytes Thanks
Amuthan, Thanks for sharing the knowledge and videos are very helpful.
One Doubt: If the method is failing , how we have to handle with ExtentLogger ? means either it pass or fail with a single line of code how can we handle?
Continue watching the framework. We wil use listeners to log failure to report
@@TestingMiniBytes sure Thank you 👍
Hi Amuthan this is an excellent content
I've one query, so we are using the Listeners for test case executions status but in the test page, the user can access the methods
from ExtentReport, example initReports(), flushReports()
can we restrict that by inherting the ExtendReport in TestListners class by giving the protected access in ExtentReport, is this the good approach? like below
public class ExtentReport { //but we can't make the ExtentReport as final
protected static void initReports() //protected access
{
if(Objects.isNull(extentReports)) {
extentReports = new ExtentReports();
ExtentSparkReporter spark = new ExtentSparkReporter(FrameworkConstants.getReportPath());
extentReports.attachReporter(spark);
}
}}
public class TestListener extends ExtentReport implements ITestListener
{
public void onTestStart(ITestResult result)
{
//code to handle the report
}
}
But if one extends the ExtentReport class, they can access the methods in ExtentReport
class(initReports(),flushReports(),createTest() )
How we can I restrict that or what is the better approach ?
And can I move the testListener class to Report class? //to get default access from the package
You should only inherit if there is proper IS A relationship.
Dog can extend Animal because Dog is An Animal
But TestListener is Not A Extent report.
Code reusability is not a priority
@@TestingMiniBytes yes, forgot this one, thanks a lot :)
I am trying to implement the listeners but every time I run the tests after implementing them it returns tests ignored and just keep spinning without executions
Sorry my bad was a typo, I chose getTestname instead of getName()
Hi, I have added testng in my pom.xml still getting an error “The import org.testng cannot be resolved”. I have been using testng 6.14.3.
Are you behind corporate proxy
@@TestingMiniBytes How to check that?
Also, on adding external testNg jars, issue is resolved but its picking testng from other location.
Instead of .m2 repository, its picking it up from .p2 repo.
@@prashantrajput3989 you can change that location to refer m2
@@TestingMiniBytes not getting an option to do that.
When i run more than 10 test cases in parallel, I am getting wrong Extent report because, Execution show Test A got fail but in report is show Test B fail with A's screenshot result mismatch can you please guide how to solve this
It is not possible as long as you have used Thread local to handle thread safety.
I have used the same code to run 100 tests in parallel
Extent reports showing old data tried debugging no success.
How to use Listeners in Junit
My project is not using Testng and need to write extent report whenever tests fails along with pass tests too.
Its simple junit groovy project .
You have after test call back, after each call back
@@TestingMiniBytes thanks for reply really appreciate i tried it but it doenst have ITestresult in junit
Hi Amuthan, is there any way to convert this extent HTML report into a pdf file format. please suggest any solution for this.
for cucumber extent to pdf, I saw about this "github.com/grasshopper7/extentreports-cucumber6-adapter". same like for our framework is it possible?
Thats a cucumber plugin to convert cucumber results to pdf. There is no direct way to achieve.
But you can try openhtmltopdf, apache fop can convert xml to pdf or wkhtmltopdf libraries to cater your needs.
@@TestingMiniBytes thanks amuthan bro for quick reply. Let me check that above mentioned things... It also nice you make video on this topics... It will be more helpful to understand deeply and for others also who are all looking for same queries.
@@TestingMiniBytes bro also please suggest any other reporting tool that generates results in pdf format.
@@lingeshsd3213 just give me sometime i will work on this pdf report
Thank you so much very help full, can you share the code with us?
Amuthan Sakthivel GitHub selenium framework youtube project
Can you share the code or github if possible?
github.com/amuthansakthivel/SeleniumAutomationFramework_TH-cam
Please create class in udemey
I already have must know java libraries sdet essentials free course
Please do attach code as well
I will do that in sometime mate.