Why do you keep repeating yourself?

After you have been writing automated checks for a while, you tend to see similar patterns emerging. One of the most common bad patterns that you will see is tests that interact with the same page, and the same elements on that page, in different ways.

This normally happens because more than one person has been automating scenarios in the same area, and as with all things, different people have different ways of doing things.

Let's take as an example a couple of basic HTML pages. First of all, we will have our index page. This is the page that everybody is going to see when they navigate to our website:

<!DOCTYPE html> <html lang="en"> <head>     <title>Some generic website</title> <link href="http://cdnjs.cloudflare.com/ajax/libs/twitter- ...

Get Mastering Selenium WebDriver 3.0 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.