简体   繁体   中英

Test Reset Password functionality with selenium and dummy email server

Im searching all day online to find an answer to this issue im having during my selenium testing.

Im trying to test if is it possible to test my sites reset password functionality while using a dummy email server. I understand I may have to use javamail (I think) for this but wanted to know if anybody knew of any possible way to maybe use a dummy email server like mailtrap or something like that, select the reset password link, reset the password and log back into my account using the new password??

Im using selenium and java for my tests.

PutsBox seems to be the anwser to your question. It's a great, easy to use tool for testing your emails via GUI.

How does this piece of joy work? Send an email to whatever-recipient-you-want-to@putsbox.com, give it a few seconds (don't blame PutsBox, email delivery services may take a few seconds) then check https://preview.putsbox.com/p/whatever-recipient-you-want-to/last , voalá, it will respond with your email content. You can also append .json to that URL to get the JSON representation. No sign up required, PutsBox is free and open source.

Basically - register your User as you would with an email such as emailAddress@putsbox.com, then you can check the newest (very important, only the newest) email sent to that account by going to https://preview.putsbox.com/p/emailAddress/last . As it is a webpage you can use Selenium and check all the elements you want in that email.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM