Book Image

Selenium Design Patterns and Best Practices

By : Dima Kovalenko
Book Image

Selenium Design Patterns and Best Practices

By: Dima Kovalenko

Overview of this book

Table of Contents (18 chapters)
Selenium Design Patterns and Best Practices
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

The random run order principle


Random run order is more of a principle than a pattern. It applies to the test execution. This execution is usually performed on a Continuous Integration (CI) environment. The random run order principle states that the order of the test suite execution should be randomized every time the suite is executed. The idea is to flush out instabilities in the test suite by introducing an element of chaos. Any test that has a hidden dependency on another test will eventually fail when the test run order is random.

Note

CI tools are simple applications that execute a given build when certain conditions such as code change are met. There are several commercial tools available, such as TeamCity, Bamboo, and Travis-CI. One of the most popular and free open source CI tools is Jenkins, which can be found at http://jenkins-ci.org/.

Advantages of the random run order principle

Let's talk about the advantages of running our tests in a random order:

  • Prevents test interdependence...