In this Code Drill 3 we look to extend the test so we’re navigating across several pages and then performing a log-in. This helps us explore how we’d design our test that requires us to hit more than one page and ends in a more realistic user journey.
Problem: Extend the simple test to navigate across several pages that leads to a log-in
Given we have navigated across several website pages to reach the log-in
When we automagically enter and submit our log-in credentials
Then we are logged in and the test passes
Approach: Pick any site you have an account for, navigate across 4 to 5 pages and perform a log-in with your credentials. (Do NOT post them here in the comments or to your GitHub repo) If testing across multiple browsers be sure to add a log-out step too.
Code: See our Code-Drills repository on GitHub for a suggested solution
Article: Read the article where we discuss our code solution to the Code Drill.
The Selenium Guys