I am trying to automate a scenario wherein I am Signing Up on a WebApp which will take my email address and send a Link to my Email address using which I can create my Password. I want to retrieve that CreatePassword link using Seleniunm-C#. I have automated up to the point where I click on Sign Up enter my details(Name, Email Address) and clicking on SignUp button which will generate a Password Link and send to my Email Address.
Easiest options would be:
1. Test email account
Create a test account where the password can be known by the team. Then, simply use this mailbox in your test as no information has to remain hidden. So Selenium can log in and get the link.
2. Test email account as proxy
If you need a 'real' email address for the test, create a test account as per above. Then, have the test account import email from the real account. Of course, this will be default get all mails... so further investigation needed.
3. API call and/or faking the link
If that really is too much of a hassle, you can skip the manual part entirely with some creativity.
Are there API calls available that you can access in your test? Maybe you can get the link this way?
Does the same user/password combination always generate the same link?
Can you insert a record into the database that will work with a link you created yourself?
For example, in my tests, by setting the same password hash in the database guarantees that my test users can all log in with the same password.
Yes you can use Gmail API...if you are using gmail id. Here you can Read and send messages, work with labels, and search for specific threads.