cancel
Showing results for 
Search instead for 
Did you mean: 

Send automatic email

New Contributor

Send automatic email

Is there any way to send automatic email once the test runner is completed(test report) using soapUI

3 REPLIES 3
Valued Contributor

Re: Send automatic email

Hi,

 

Yes, this is certainly possible. I did two recipes (custom reporting & emails via SMTP/Gmail) like this in my book.

 

I cannot share the code, but I can give you tips/pointers.

 

The are several options, but generally it takes some Groovy scripting & access to an SMTP server of some kind.

 

Here's one rough approach:

  1. Under the teardown script tab of either the TestCase or TestSuite, iterate over the TestCaseRunner.results collection e.g. for ( testCaseResult in runner.results ) {...}, build up your report as text/html/xml, whatever you need.
  2. Open an SMTP connection (plenty of java code examples that can be found and used in Groovy)
  3. Send your report data

Does this make sense as a starting point? (its easier than it may sound)

 

There is also a email TestStep plugin that you may be able to adapt:

 

https://sourceforge.net/projects/soapui-plugins/files/soapui-emailteststep-plugin/

https://github.com/olensmar/soapui-emailtestsstep-plugin

 

Regards,

Rupert

Author of SoapUI Cookbook
New Contributor

Re: Send automatic email

Thanks for the reply.

 

Need inputs for below,

 

I have used groovy script to send Email but i want to know how to invoke groovy script for Testrunner command line and once the Testrunner is complete, it should attach the test report to the email and send it to the recipients

 

 

Is it possible ??

Community Hero

Re: Send automatic email

Prefer to use Project's Teardown script for the same.


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win