Start building your web presence at Rs. 499.00/mo

Start building your web presence at Rs. 499.00/mo
Web Hosting Coupon Archives

How to Send report through email in Selenium Webdriver

Step by Step process to Send report through email in Selenium Webdriver

  1. Download java mail jar file which contains the library to send the email.
  2. download-jar-for-email
  3. Add jar into your project and if you are working with maven project then you can use dependency.
  4. Be ready with the file which you want to send. In our case, it will be Selenium Report.
  5. Write program, which will send the email to the team or a specific person.

Complete program to Send report through email in Selenium Webdriver



Above program will send the report to the respective recipient with the attachment. 
You can also send  the email via Jenkins which is quite easy but you are not using Jenkins then you can use above program.

Important points

1- You can create a custom library which should accept recipients as arguments so that we can reuse this as much we can.
2- Write the logic to get the path of the report, so that we can set the same in our methods.
3- Always call this code after test execution. You can use @AfterSuite of TestNG which run only when complete suite execute.

Conclusion

1- Sending reports after every execution is very important but if you are running multiple tests in one day better to send combined reports at once.
2-Try to keep all screenshot in a common location where everyone will have access so when they click on report and screenshot then it should be accessible.
I hope you liked above article on Send report through email in Selenium Webdriver.
Please try from your side as well and let me know if any thoughts on this.
Sharing knowledge can seem like a burden to some
but on the contrary,
it is a reflection of teamwork and leadership.
So kindly share with your friends and team member.
SHARE

yash

  • Image
  • Image
  • Image
  • Image
  • Image

3 comments:

  1. Thanks for sharing this post. It will help me to learn how i can send Send report through email in Selenium Webdriver

    ReplyDelete
  2. This was really an interesting topic and I kinda agree with what you have mentioned here!

    cheap web hosting in lahore

    ReplyDelete
  3. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
    Digital Marketing Agency in Pakistan

    ReplyDelete