Code Drill 4 is similar to what we’ve seen in Drills 1 and 3, but this time we want to confirm the form was submitted successfully.
Problem: On submitting a web form we need to confirm it was sent successfully by checking the site’s confirmation message
Given we have completed and submitted a web form successfully
When the site responds with the confirmation page
Then we’re able to assert certain text is present that proves successful form submission
Approach: Pick any site that that has a simple web form, write a script to complete and submit it. Extend the script to then assert the presence of text on the page that shows you the form was sent successfully.
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