How to send an automated email with test reports using Maven and TestNG

2,395 views
Skip to first unread message

Deepa Kiran Bagepalli

unread,
Dec 13, 2013, 6:11:56 AM12/13/13
to testng...@googlegroups.com
Hi All,
I am using Sikuli+TestNG+Maven for automation and i am generating testng xslt reports which are stored under /target/testng-xslt-reports/ folder in my project path.
When i run command "mvn test site", my testng suite is run and i get the xslt reports in this folder. Now i want this report to be sent automatically to my company email id as soon as report is generated.
For this, I am trying to configure maven post man plug-in in my pom.xml but its showing errors and not successful. I am trying to use gmail as smtp and my gmail address as from address.
Below is the plugin added in my pom.xml

<plugin>
        <groupId>ch.fortysix</groupId>
        <artifactId>maven-postman-plugin</artifactId>
        <executions>
            <execution>
                <id>send a mail</id>
                <phase>site</phase>
                <goals>
                    <goal>send-mail</goal>
                </goals>
                <inherited>false</inherited>
                <configuration>
                    <from>myem...@gmail.com</from>
                    <subject>Test Execution Report</subject>
                    <failonerror>true</failonerror>
                    <mailhost>smtp.gmail.com</mailhost>
                    <mailuser>myem...@gmail.com</mailuser>
                    <mailpassword>MyPassword</mailpassword>
                    <mailport>465</mailport>
                    <mailssl>true</mailssl>
                    <mailAltConfig>true</mailAltConfig>
                    <htmlMessageFile>target/testng-xslt-report/index.html</htmlMessageFile>
                    <receivers>
                        <receiver>myus...@company.co.in</receiver>
                    </receivers>
                </configuration>
            </execution>
        </executions>
    </plugin>

Do i need to add any dependencies to use this plug-in ? OR do i need to make some settings in my gmail account ?
OR if there is any other better way to send automation emails , please suggest.

Thanks & Regards
Deepa

Aakash Singhal

unread,
Dec 15, 2013, 4:41:24 AM12/15/13
to testng...@googlegroups.com
If anyone has the answer please reply m also facing the same issue.

Krishnan Mahadevan

unread,
Dec 17, 2013, 3:55:39 AM12/17/13
to testng...@googlegroups.com
This question doesnt seem to be related to TestNG but is more of a maven postman plugin question.

You might want to try googling around this or post on StackOverFlow


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.

Sergey Kuts

unread,
Dec 18, 2013, 6:06:54 PM12/18/13
to testng...@googlegroups.com
When you reach CI level, Maven won't be an option for sending emails. I strongly recommend you to try Jenkins.

пятница, 13 декабря 2013 г., 13:11:56 UTC+2 пользователь Deepa Kiran написал:
Reply all
Reply to author
Forward
Message has been deleted
0 new messages