Reputation: 1
I have a scenario a single sign on page before a user can get a full access to the secure site, they have to request for a one-time password using the request button on the page, the one password is then sent to their inbox.
First screen user enters username and password and click login then gets to the second screen which they have to request for the one-time password
The script will have to sleep and get.url to email, get the password from email and back to the single sign on page and paste, click on the submit button and secure page is now displayed.
How do I go about writing this script?
I have a pageobject called LoginPage and Testcase called LoginTest
Upvotes: 0
Views: 417
Reputation: 8386
You will need to automate an email. This will mean that you should use a service that connects to email via IMAP or POP (If you don't know what services, check out this answer).
The process will look something like this:
Login, and have email sent
Connect to email via IMAP/POP3
Get the text of the email (you may have to do parse afterwards)
Type in the code
Upvotes: 1