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 helping to automate an new web application, part of this application requires email verification. What are the industry standards for automating the black hole known as "email"? What I'm trying to do is automate this piece of functionality without having any dependency on third party applications, like outlook or gmail.

  • Should these emails be stored in a database via the application and then retrieved?
  • Should we have an email sniffer that make the emails available via text file or again in db?

FYI, we are using the webAii automation framework.

share|improve this question
1  
what do you mean by 'verification' ? what exactly are you trying to test - that emails are sent out ? –  Phil Kirkham Oct 18 '11 at 17:18
    
We are trying to automate a work flow, part of the work flow is emailing a user and clicking a link within the email. There is more to it but the "email" part of the test case is what has me stumped. How do I automate without depending / qaing a third party app. –  Stefano D Oct 18 '11 at 17:21
1  
can you separate that part out ? Some part of your app is generating a link so automate that link click, putting the link into an email is another test ? –  Phil Kirkham Oct 18 '11 at 17:54
    
I'm trying to automate the link click but I have no mechanism to retrieve the link other than email. So that is what I'm asking, how do others who automate UI's handle this sort of scenario? I could ask development or IT to create a mechanism that makes the link available to me but I don't know what the "right way" is. –  Stefano D Oct 18 '11 at 20:12
    
Do you have (or can you create) a Mock of the email library being used? Including send and receive functions? Then your workflow test just tests the workflow itself and doesn't need to worry itself about the details of the email messages. –  dodgy_coder Oct 19 '11 at 5:06
add comment

4 Answers 4

I have done a simple thing.

  1. Setup a IMAP/POP3 mail server
  2. Send the mail to server
  3. Retrieve the mail from the server using code. (Java Mail API for example)
  4. Do further actions.

I don't know about any industry standard. But this works for me.

share|improve this answer
1  
+1 for "I don't know about any industry standard. But this works for me. " –  Tarun Nov 26 '11 at 18:08
    
This is pretty bang on. For any serious email testing you need to have your own server or simulator. In the past I have used one that dropped a file containing the email onto a file share with a known file name and accessed them from there. –  Bruce McLeod Mar 3 '13 at 21:38
add comment

As best as I can tell, you have two problems: you want to verify that the email is sent but you don't want to depend on an existing email provider; and you want to test what happens when an email's embedded link is clicked.

For the first problem, I would probably configure a test mode in the server in which it would write files to the file system or to a database. In the past, I have accomplished the latter by implementing a custom provider in the Java Mail API.

For the second problem, I would parse the email to extract the verification URL. (I assume you know how to simulate the click once you have the URL.)

Of course, this approach will not check whether the email is legible or understandable or whether the email layout is correct in Outlook or in any of the popular email readers like Gmail or Yahoo Mail, but you can always do that by hand.

share|improve this answer
add comment

Are you trying to test the actual email verification process itself, or is the verification just a necessary step to enable further testing of other features?

If the latter, you might consider it cheaper to provide a test-specific(*) method to simply set an email address as 'verified' and leave the testing of email verification itself to your manual testing. Especially considering you're likely to want to do email verification by hand anyway to check it actually delivers to 3rd party inboxes and looks right (to a human).

(*) Make sure you don't leave this method enabled in a production build unless suitably protected!

share|improve this answer
add comment

Disclaimer - I work for the company that made this.

You might find that a hosted service such as Mailosaur is helpful for this.

You can of course set up something like this yourself , but the benefit of someone else doing the hard work is obvious.

share|improve this answer
add comment

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.