cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a test case that requires TestComplete to access and retrieve text from an e-mail

SOLVED
Highlighted
Contributor

How to write a test case that requires TestComplete to access and retrieve text from an e-mail

I am currently working on a keyword test that needs to provide a verification code from an e-mail address in order to login to my site. I originally had this test case set up to navigate to google gmail and read the e-mail, but it no longer appears to be working. I suspect there is a better approach to dealing with this scenario since it relies heavily on a 3rd party (Google). I am open to using a different e-mail (ie. Microsoft Outlook), but I would like to know if there is a best practice for handling these situations where MFA verification codes are required to login/verify e-mail.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: How to write a test case that requires TestComplete to access and retrieve text from an e-mail

The best is to use a mail system having the option to automatically save newx email as text file in specified folder. Thus you can simply parse a text file on disk to have your code.

On Outlook you have sone addins which does that but you must buy it.

 

Another solution is to use REST API of Outlook to get your mail yourself and analyse the mailItem element.

https://docs.microsoft.com/fr-fr/graph/api/resources/mail-api-overview?view=graph-rest-1.0

 

Others solutions implying GUI aren't reliable.

 

 

 

Un sourire et ça repart

View solution in original post

3 REPLIES 3
Highlighted
Community Leader

Re: How to write a test case that requires TestComplete to access and retrieve text from an e-mail

The best is to use a mail system having the option to automatically save newx email as text file in specified folder. Thus you can simply parse a text file on disk to have your code.

On Outlook you have sone addins which does that but you must buy it.

 

Another solution is to use REST API of Outlook to get your mail yourself and analyse the mailItem element.

https://docs.microsoft.com/fr-fr/graph/api/resources/mail-api-overview?view=graph-rest-1.0

 

Others solutions implying GUI aren't reliable.

 

 

 

Un sourire et ça repart

View solution in original post

Highlighted
Contributor

Re: How to write a test case that requires TestComplete to access and retrieve text from an e-mail

Thank you very much!

Highlighted
Occasional Contributor

Re: How to write a test case that requires TestComplete to access and retrieve text from an e-mail

I have a similar issue.  I was using outlook, and it was mostly accurate, however, I would be interested in a more robust solution.   Would you mind sharing how you solve this using the outlook rest-api and which requests worked for you.  

Thank you

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors