Forum Discussion

premanand_r's avatar
premanand_r
Occasional Contributor
11 years ago

How to check mail sent in Forgot password Functionality.

Is there an option in testcomplete10 to check for mail sent from the application when we click on forgot password link in login page.



Thanks & Regards,

prem

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi,



    For obvious reasons there is no such built-in functionality in TestComplete and you must implement it yourself with the knowledge of specifics of your mail server and mail contents.

    The scenario is something like this:

    a) Create a dedicated user with e-mail address on the mail server that is convenient for you;

    b) Trigger functionality in your application to send an e-mail for the user from step a);

    c) Connect to the mail server and check in cycle user's mailbox during some time period that is enough for the mail to be delivered. Within the check cycle check if the new mail has been arrived and if it is from your application. If it is, then get password from it and use the new password for the test.

    The questions like 'how to connect to the mail server' and 'how to get password from the mail' must be addressed with the knowledge of what mail server is used and how the mail is formatted. Usually it should be possible to get the password from the mail using regular expressions. As for the connection to the mail server, there are a lot of code samples in the internet for different scripting languages (VBScript, JScript, etc.) and mail servers (Exchange, gmail, hotmail, etc.).