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 Black Hole Proxy pattern


The Black Hole Proxy pattern tries to reduce test instability by getting rid of as many third-party uncertainties as possible. Modern websites have a lot of third-party content loaded on every page. There are social networking buttons, images coming from CDNs, tracking pixels, and much more. All of these items can destabilize our tests at any point. Black Hole Proxy takes all HTTP requests going to third-party websites and blocks them, as if the request was sucked into a black hole.

Note

Web pages that have heavy traffic in the production environment tend to cache their JavaScript and the cached assets on a third-party CDN. When testing an environment such as production, we should not be blocking critical assets but allowing them to be properly loaded using the proxy whitelist feature.

Advantages of the Black Hole Proxy pattern

Black Hole Proxy brings many advantages to our tests:

  • Improved speed: Since the web applications we test tend to be on the local network...