Test your tests!

A last thought before we close this chapter: not enough time and thought is given to the idea of testing the tests themselves. One should not hurry in adding a new test to the suite without running it at least a dozen times. Personally, I tend to run each new test about 20 times before I consider it stable. Just put the tests in a loop, let it run for 20 minutes while you get a cup of coffee. You will be surprised how often a test will fail if you just let it run enough times.

Finally, don't forget to test your tests on multiple browsers. As a rule of the thumb, any test you will write will be a lot more stable in Firefox and Chrome browsers than they are in Internet Explorer and Safari. Just because you got stability in the test ...

Get Selenium Design Patterns and Best Practices 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.