Step 1: Confirm You’re on the Right Test Page

Before doing anything fancy in a test, it’s always good to confirm you’re testing the right page. I know, this sounds obvious. But you’d be surprised how much time you can waste thinking you’re testing one page, when you are inadvertently testing another.

The easiest way to verify you’re hitting the right page is simply to navigate to it in your test, and then print out the HTML response that comes back.

images/legacy/print.png

We haven’t covered the basics yet around how HTTP requests and responses work (hang in there, we’ll do this shortly in Chapter 4, Connecting the Dots with Integration Tests). But all we are doing ...

Get The Way of the Web Tester now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.