Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm testing an Email system where I would test a set of received emails to see if the received emails actually displayed as expected.

This is done for each release of the system. So basically I want to automate this process. When the emails are received, the automated testing process should open each email through the web browser (because emails are typically sent to Gmail account) and validate them.

Also in the manual testing process, each email is identified by a string in the email content.

share|improve this question
2  
Hi, Sinaru, when you say "displayed as expected" do you mean that they contain all the text you expect, or that they contain the text and markup you're expecting? If you're wanting to validate text, that's fairly easy. Validating layout, markup and display is something that's often better handled manually. –  Kate Paulk Aug 15 '13 at 11:35
1  
If you just want to know whether the email arrives in your Inbox or gets stuck in your Spam folder, there is a simpler way to do that. –  user246 Aug 15 '13 at 12:47
    
When you say, you are testing an Email system, are you testing the sending part of the system (MTA) or are you using a service and want to test that it sends your emails correctly? –  Suchit Parikh Aug 15 '13 at 16:38

3 Answers 3

up vote 3 down vote accepted

Since everything is web based, can't you just use a strait up browser automation framework like Selenium?

  • Do what you need to do in your system to trigger the sending of the email.
  • Log into Gmail
  • Check if the email is there
  • Take a screenshot (if needed)

Anything you can do as a user (besides thinking and seeing if visual layout is nice) you can more or less do in some flavor of Selenium.

===

My bad I misread the question. You can just fire up a selenium browser in a process that sits in gmail in HTML Only mode, checks for new messages every X seconds (by pulling for the elments), and then opens the emails and runs whatever test you want to do on the email.

share|improve this answer
    
Gmail in html mode is easy mode for automating email-related tasks. You can record a sample test in selenium and edit it to meet your needs; might be up and running in as little as a few hours. –  Lucas Schwarz Aug 26 '13 at 22:43
    
Thanks for the feedback guys. –  Sinaru Dec 6 at 7:03

I'm not sure what using Gmail will do to repeatably. If the Emails have the same structure with small differences (e.g. the date or version number) why not compare the text or binary parts to a golden copy of the Email ?

share|improve this answer

Disclaimer - I work for the company that made a solution for this scenario.

mailosaur.com gives you unlimited test email addresses and a fake SMTP server. Each time an email is received, it will parse the html and extract all the links, optionally visit all these links and store the responses etc...

There's a REST API which allows you to access any property of your email for validaton. We have bindings for Java, .NET and Ruby to make your life as easy as possible.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.