Search code examples
seleniumgmailautomated-tests

Automatic reply from Gmail to WebMail


I'm using Selenium WebDriver to test the web mail I've develop in one of my websites.

How can I set up a test script that when I send an email from the web mail to Gmail, Gmail will automatically reply to that email? I'm still fairly new using Java language.


Solution

  • I don't think setting up a selenium script to send a reply from gmail is the way to go. Since you are testing only your own application, you should refrain from creating scripts to automate replies from gmail as they further add a level of complexity and extra effort.

    There are better ways to do what you want and I believe "Canned Responses" in gmail labs can be your savior. Check out this link for more information on it :

    Auto Responder to specific email addresses

    You can also connect to the gmail address via POP3 in your java code and check for the email from your web mail and respond to that via java code itself. However, I think, the above solution (Canned Responses) would be the cleanest and the best approach.