MainMenu

Home Java Overview Maven Tutorials

Tuesday, 6 February 2018

Send Reports Automatically to Email using Maven from Eclipse




Hell Friends,

In this article we will discuss

How to Send Reports Automatically to Email using Maven from Eclipse by Post-Man plugin



For Video :

Click here

This is very simple, you just need to add some plugin & remaining things will be same.
So steps will be as below :
Step 1 : Create a Maven Project.
Step 2 : Add Dependency as below in your POM.xml file.
Step 3 : Update the project.
Step 4 : Convert your Execution file to TestNG xml file & place it in main source folder(if using below plugins).
Step 5 : Set email address & report path.
Step 6 : Now Run your POM.xml file.

To Download the complete plugin in notepad click the below link :

click here



Alternatively, one can copy the below plugin & paste in his Maven Pom.xml file.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Report_demo</groupId>
<artifactId>Report_demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<suiteXmlFile>src/main/resources/testng.xml</suiteXmlFile>
</properties>
<dependencies>
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.1</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.6.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<groupId>ch.fortysix</groupId>
<artifactId>
maven-postman-plugin</artifactId>
<executions>
<execution>
<id>send a mail</id>
<phase>test</phase>
<goals>
<goal>send-mail</goal>
</goals>
<inherited>true</inherited>
<configuration>
<!-- From Email address -->
<from>cchauhan281188@gmail.com</from>
<!-- Email subject -->
<subject>Test Automation Report</subject>
<!-- Fail the build if the mail doesnt reach -->
<failonerror>true</failonerror>
<!-- host -->
<mailhost>smtp.gmail.com</mailhost>
<!-- port of the host -->
<mailport>465</mailport>
<mailssl>true</mailssl>
<mailAltConfig>true</mailAltConfig>
<!-- Email Authentication(USername and Password) -->
<mailuser>Enter email id here</mailuser>
<mailpassword>Enter password here</mailpassword>
<receivers>
<!-- To Email address -->
<receiver>cchauhan32@gmail.com</receiver>
</receivers>
<fileSets>
<fileSet>
<!-- Report directory Path -->
<directory>C://workspace//SendMavenEmail//Reports</directory>
<directory>E://java_oxygen//Report_demo//Reports</directory>
<includes>
<!-- Report file name -->
<include>TestReport.html</include>
</includes>
<!-- Use Regular Expressions like **/*.html if you want all the html files to send-->
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>



Here is the sample code

package com.lang.Execution;
import java.io.IOException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;
public class ReportTest
{
WebDriver driver;
ExtentReports report;
ExtentTest logger;
@BeforeTest
public void navigate() throws InterruptedException, IOException
{
System.setProperty("webdriver.chrome.driver", "D:\\Selenium\\Complete selenium\\ChromeDriver\\chromedriver.exe");
driver=new ChromeDriver();
driver.manage().window().maximize();
driver.navigate().to("http://www.way2testing.com");
Thread.sleep(3000);
report=new ExtentReports("./Reports/TestReport.html");
}
@Test(priority = 0)
public void title()
{
logger=report.startTest("Verifytitle");
logger.log(LogStatus.INFO, "test started ");
System.out.println("Your Title is :" + driver.getTitle());
String title = driver.getTitle();
if(title.equalsIgnoreCase(" Online Software Testing: Software Testing"))
{
logger.log(LogStatus.PASS, "Test Verified");
}
else
{
logger.log(LogStatus.FAIL, "Test Failed");
}
report.endTest(logger);
//Flush the data to report
report.flush();
}
@Test(priority = 1)
public void clicklink(){
//Create object for Report with filepath
//report=new ExtentReports("./Reports/TestReport.html");
//Start the test
logger=report.startTest("Verifylink");
//Log the status in report
logger.log(LogStatus.INFO, "Test started ");
driver.findElement(By.xpath(".//*[@id='post-body-751561208295527719']/div[1]/table/tbody/tr[6]/td[1]/a/img")).click();
//Pass the test in report
logger.log(LogStatus.PASS, "Link Verified");
//End the test
report.endTest(logger);
//Flush the data to report
report.flush();
}
}







Tags :

how to send report through email in selenium webdriver,Sending Selenium Reports through mail,
Advance Selenium Reporting- Selenium Webdriver tutorial How to Send a Report via Email in selenium,
How to generate and send HTML reports using Selenium WebDriverSend Reports Automatically to Email using Maven from Eclipse
Robotically Send Test Reports via Mail Using Maven Postman PluginHow to send Test result to email using maven by postman plugin
how do i send a email test report from maven,How to send an automated email with test reports using Maven and TestNG,

85 comments:

  1. How to Send Reports Automatically to Email using Maven from Eclipse by Post-Man plugin for negative test cases

    ReplyDelete
  2. This is really a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it Email Database

    ReplyDelete
  3. After you have identified your market you are now ready to make your first communication with them. Email List

    ReplyDelete
  4. Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. Workflow Management

    ReplyDelete
  5. Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work. email list

    ReplyDelete
  6. i really like this article please keep it up.
    business email

    ReplyDelete
  7. I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. como abrir correo hotmail

    ReplyDelete
  8. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. fraud detection

    ReplyDelete
  9. Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. www.hotmail.com entrar

    ReplyDelete
  10. hello!! Very interesting discussion glad that I came across such informative post. Keep up the good work friend. Glad to be part of your net community. Search Engine Scraper Bot

    ReplyDelete
  11. I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best! Facebook Groups Scraper

    ReplyDelete
  12. A committed group is fundamental to join different marketing systems. https://marketbusinessnews.com/social-media-panels-2020/242030/

    ReplyDelete
  13. Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best. wiflix

    ReplyDelete
  14. I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! ECBA certification

    ReplyDelete
  15. Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. best email extractor tools

    ReplyDelete
  16. Admiring the time and effort you put into your blog and detailed information you offer!.. pst email extractor

    ReplyDelete
  17. Whenever I have some free time, I visit blogs to get some useful info. Today, I found your blog with the help of Google. Believe me; I found it one of the most informative blog. send email to 1000 recipients

    ReplyDelete
  18. What a thrilling post, you have pointed out some excellent points, I as well believe this is a superb website. I have planned to visit it again and again. bulk email service provider

    ReplyDelete
  19. Select In Features-Unfortunately, there could be the point at which your contact is not, at this point inspired by your offers or business. The individual in question ought to have a choice to leave your program. how to make a group email list on ipad

    ReplyDelete
  20. Much the same as some other "fight", the more hopefuls you have playing, the harder the opposition will be.Lead generation

    ReplyDelete
  21. Incorporating social media into your site is simple. There are destinations that give the code and symbols to you to just glue into your web structure. When you are using social media ensure you show it SMM Panel

    ReplyDelete
  22. Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! one funnel away challenge

    ReplyDelete
  23. Im no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. sketch.

    ReplyDelete
  24. Thanks so much for this information. I have to let you know I concur on several of the points you make here and others may require some further review, but I can see your viewpoint. Create your Own Expert Advisor

    ReplyDelete
  25. Keep up the wonderful piece of work, I read few posts on this internet site and I think that your blog is really interesting and holds bands of fantastic information. CheapSoft4you

    ReplyDelete
  26. I wrote about a similar issue, I give you the link to my site. Website design London

    ReplyDelete
  27. Thank you for very usefull information.. OrbitEx

    ReplyDelete
  28. You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. ray ban eyeglasses

    ReplyDelete
  29. It is hard to pinpoint which of these free online marketing apparatuses work and which don't however advancement in any structure can't be terrible, so I invest a little energy on each. SEO

    ReplyDelete
  30. Keep up the wonderful piece of work, I read few posts on this internet site and I think that your blog is really interesting and holds bands of fantastic information. 먹튀검증

    ReplyDelete
  31. You have under 10 seconds to persuade a site guest to stay adequately long to find out about the nature of your administrations, your items or your message. Web surfers are spiked out on data over-burden. Webdesign

    ReplyDelete
  32. I heard about the 5 qualities that make a name awesome from this product naming agency? I heard a lot of people were able to come up with various creative names because of this. what google did to me

    ReplyDelete
  33. Initial You got a awesome blog .I determination be involved in plus uniform minutes. i view you got truly very functional matters , i determination be always checking your blog blesss. why not try here

    ReplyDelete
  34. In today’s society, naming your brand is a difficult, but necessary task. However, when I enrolled this course, I found myself entertained and informed enough to start naming my brand.  Email Harvester

    ReplyDelete
  35. Hey i’m for the first time here. I came across this board and I find It seriously helpful & it helped me out much. I hope to give something back and aid others as you aided me. Ssndob

    ReplyDelete
  36. As far as me being a member here, I wasn’t aware that I was a member for any days, actually. When the article was published I received a notification, so that I could participate in the discussion of the post, That would explain me stumbuling upon this post. But we’re certainly all members in the world of ideas. e waste problems

    ReplyDelete
  37. Deciding on a brand name is one of the common mistakes of startup companies. Having names that is thoroughly thought off is an edge that can lead your company to success. Email Extractor

    ReplyDelete
  38. It is a natural method of streamlining your online substance to improve the positioning of your site on the web crawler. SEO Limburg

    ReplyDelete
  39. As I was sitting on a rock in India, looking over the city of New Delhi, contemplating on my next decision, I was chastened to submit my thoughts and passion about money unto the world. Capitalism shall grow in abundance; the entire economic system of our world is impossible without credit. Our entire civilization is based on money, from Babylon, to New York City. The hope of our time is based off the fact that Rachel will control the world through her music and love. She shall reign like a queen over billions and billions, and I shall support her by contemplating my next decision looking off to the distance, because this, this is how I receive revelation, with the common interest of money and overseas trades that the world depends on. MecSoft RhinoCAM 2018 Build 8.0.28 for Rhino 6 sale

    ReplyDelete
  40. Thanks for every other informative site. The place else may just I get that kind of information written in such an ideal means? I have a venture that I’m just now operating on, and I have been on the look out for such information. quenza software

    ReplyDelete
  41. After arriving at this level, we likewise need to set up our general public for harmony, and to ensure the harmony, innovation should be modified to cultivate the approach of war.TutuApp web

    ReplyDelete
  42. A great impatience above which you want become offering these. ill definitely appear further earlier once more https://tipandroid.com/ since the identical practically a lot usually inside of circumstance an individual defend this kind of increase.

    ReplyDelete
  43. If your son or daughter is struggling in math class and needs math homework help, a math tutor can prove to be a valuable resource! The math tutor can not only present the material covered in class in a manner conducive to your child's learning style, but can also ensure that he or she stays ahead of the curve by focusing on skills that he or she may not have fully grasped in previous math courses. online math class

    ReplyDelete
  44. Sudden advancement or lucrative propositions for employment will make everybody happy, except when you consider the moving interaction your superb face turns dull. Pressing, stacking, organizing, shipping, and dumping are tedious and overwhelming cycle, which will totally deplete your energy.removal company south London

    ReplyDelete
  45. I understand this column. I realize You put a many of struggle to found this story. I admire your process. email extractor software

    ReplyDelete
  46. You made a great point! Thanks to this brand naming firm's new online course learning, all the knowledge that they shared with me led my new business to having an interesting name.  her latest blog

    ReplyDelete
  47. While hand embroidery is likely more mind boggling and all the more exceptionally valued as it ages, digitized embroidery is significantly quicker and grants you to sell your tasks just as to utilize the numerous advanced examples that you will discover on the web. logo digitizing,

    ReplyDelete
  48. It is fine, nonetheless evaluate the information and facts around this correct. CBT Mass Email Sender for Bulk Email Blasts

    ReplyDelete
  49. It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing. internet marketing Salem

    ReplyDelete
  50. Respect to author , some great information . Buy Ansys Products 2021 R1

    ReplyDelete
  51. I really like your writing style, great information, thankyou for posting. csgo smurfs accounts

    ReplyDelete
  52. Email promoting administrations give viable and simple approach to get accomplishes wanted advertising objectives. Through Email benefits your message or administrations is shipped off clients. It's likewise assists with developing relationship with the clients by customized and pertinent email correspondences. Email showcasing is a best and least expensive approach to disseminate your business messages to clients or public portion by means of mailer (email). non permission based email marketing

    ReplyDelete
  53. Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. Produits local

    ReplyDelete
  54. For this web site, you will see our account, remember to go through this info. email extractor from website

    ReplyDelete
  55. Your blogs further more each else volume is so entertaining further serviceable It appoints me befall retreat encore. I will instantly grab your rss feed to stay informed of any updates. email extractor 1.4lite

    ReplyDelete
  56. Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards, chen zhi prince group

    ReplyDelete
  57. I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, im always look for people to check out my web site. check this out

    ReplyDelete
  58. In this case you will begin it is important, it again produces a web site a strong significant internet site: Software

    ReplyDelete
  59. You should mainly superior together with well-performing material, which means that see it: Email Extractor

    ReplyDelete
  60. Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing... Yellow Pages Scraper

    ReplyDelete
  61. I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! neak oknha chen zhi

    ReplyDelete
  62. I use basically superior fabrics : you will discover these products by: browse around this web-site

    ReplyDelete
  63. Streamlining essentially implies making a site that is all the more effortlessly found via web crawlers. To do this, you'll need to sprinkle your watchwords all through the substance on your page, including video titles, slogans, your URL, elective content, in your captions, and so on Fundamentally, you need the catchphrases to appear so when a question is entered, https://www.buyyoutubesubscribers.in/

    ReplyDelete
  64. Web optimization, HTML, select in records, presentation pages - the entirety of this won't make any difference if the future advertiser doesn't have a clue how to really prevail with the apparatuses available to them. SEO services in Hyderabad

    ReplyDelete
  65. I am grateful for your post. Id really like to comment that the expense of car insurance varies greatly from one coverage to another, since there are so many different issues which give rise to the overall cost. As an example, the model and make of the motor vehicle will have a large bearing on the fee. A reliable old family car will have a more affordable premium when compared to a flashy expensive car. OrCAD 17.2.0 for sale

    ReplyDelete
  66. I conceive this website has got some real great information for everyone : D. CGTech Vericut 9.0.1 for sale

    ReplyDelete
  67. Bharat Go Digital is a premium digital marketing agency based in Bangalore. Hire them for their best SEO services.
    SEO Expert India

    ReplyDelete
  68. There’s noticeably a bundle to know about this. I assume you made sure nice factors in options also. where to buy steroids

    ReplyDelete
  69. ther are many outdoor decors out there on the local hardware but we always use outdoor decors coming from recyclable materials* hcg for sale

    ReplyDelete
  70. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. Zendable

    ReplyDelete
  71. bedroom furnitures should be sized up and paired with the color and type of your beddings, buy hcg

    ReplyDelete
  72. Good day. i am doing research right now and your blog really helped me,    anavar for sale

    ReplyDelete
  73. In the present situation more and more people are choosing Share Hosting Services because of a lack of knowledge. Shared Hosting looks very attractive to every one as they are the cheapest option available in the market. In the present scenario we must go for cheaper options but we must take care of the quality of services. Meanwhile there are other hosting options also which are not very expensive but more secure and reliable. https://onohosting.com/

    ReplyDelete
  74. I discovered your blog site website on google and appearance a number of your early posts. Maintain inside the excellent operate. I just additional the RSS feed to my MSN News Reader. Looking for forward to reading much more on your part afterwards!… steroids for sale

    ReplyDelete
  75. This situation document appears to redeem a good deal of audience. Determine how to market it? The idea provides a amazing completely unique distort onto stuff. Reckon offering anything proper or alternatively great offer information about is central to the subject. Buy OrCAD 17.2.0 for sale

    ReplyDelete
  76. Best Havells induction cooktop in india
    Havells India Limited is a leading Fast Moving Electrical Goods (FMEG) Company and a major power distribution equipment manufacturer with a strong global presence.
    Visit: Best Havells induction cooktop in india

    ReplyDelete
  77. After reading this series of articles, you will be armed with the insights into the web hosting industry; you will know what to look for and what questions to ask. https://onohosting.com/

    ReplyDelete
  78. Your content is very inspiring and appriciating I really like it please visit my site for Satta King Result also check Satta king 24X7 and also check sattakingand for quick result check my site Satta matka and for super fast result check Satta king result and you can also check sattaking result

    ReplyDelete
  79. They're produced by the very best degree developers who will be distinguished for your polo dress creating. You'll find polo Ron Lauren inside exclusive array which include particular classes for men, women. World Market Link

    ReplyDelete
  80. your content is very inspiring and appriciating I really like it please visit my site for Satta King Result also check Satta king 24X7 and also check sattaking and for quick result check my site Satta matka and for super fast result check Satta king ohttp://sattavipkingg.moonfruit.com/r delhi satta king

    ReplyDelete
  81. From the above measurements, it is obvious that the size of an association assumed a part in the assurance of the measure of profits got.topic cluster là gì

    ReplyDelete