QTP/UFT – Sending out Email with Test Results using Jenkins

I had already explained in this article that we do a smoke test after every build to confirm if the critical functionalities of the application is working fine or if the application is testable. We do that by selecting few important test cases from the automated regression suite & execute that as part of every build to get the immediate feedback about the application. I will show you how we can achieve this using UFT/QTP.

 

Smoke Test Script:

First I need a working QTP/UFT script. I have uploaded a sample QTP/UFT script as part of this article. So, We can reuse the same script as our smoke test script.

 

Test Results:

We need our QTP/UFT script to create a decent HTML report.  I created a VBScript utility to create a simple HTML result file as given below.
html-report-001

Below code will produce the above HTML table. I have uploaded this in the GitHub repository. You can leave a star :),  clone the script, modify & play around!!

Jenkins EMail Notification:

We have a working QTP/UFT script. We also have modified the script to create a report in format we want. Now we need to send this out to the entire team once the test is done.

This is very simple and straight forward.

  • Install Email-ext plugin in Jenkins.
  • Configure your SMTP email server details in Jenkins. [Jenkins -> Configure System]

html-report-003

 

I have used gmail smtp server just for this article – demo. You can use your organization smtp server details. If you would like to use gmail smtp server – ensure that your organization does not block the firewall. To check if the firewall is open or not, use this in command prompt & you should be able to connect -> telnet smtp.gmail.com 465.

  • Click Save.
  • Go to Jenkins QTP Job
  • Click on Configure
  • Go to Post Build Action
  • Add Editable Email notification

html-report-004

  • Update a Pre-Send script section with the below code. This is to get the HTML report we create using QTP & send it as email content.

  • Add a trigger for ‘Always‘.  [Depends on your requirement. I always send out the email with the test status]

html-report-006

  • Click Save.
  • Trigger the Jenkins Job for the automated test execution & get the test results in the eMail.

html-report-007

 

Summary:

Sending out email notification is very simple to configure and improves your current test process. This automated smoke test process works great for us & helps us to get the immediate feedback about latest code after deployment. In case of issues Dev team can look into the issue immediately instead of waiting for the QA team to test and report the issue which could increase the downtime in case of critical issues.

Please leave a comment below for any questions/suggestions/appreciation!!

 

Happy Testing 🙂

 

 

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.