Book Image

Selenium Testing Tools Cookbook

By : UNMESH GUNDECHA
5 (1)
Book Image

Selenium Testing Tools Cookbook

5 (1)
By: UNMESH GUNDECHA

Overview of this book

This book is an incremental guide that will help you learn and use the advanced features of the Selenium toolset including the WebDriver API in various situations to build a reliable test automation. You start off by setting up the test development environment and gain tips on the advanced locater strategy and the effective use of the Selenium WebDriver API. After that, the use of design patterns such as data - driven tests and PageFactory are demonstrated. You will then be familiarised with extending Selenium WebDriver API by implementing custom tasks and setting up your own distributed environment to run tests in parallel for cross-browser testing. Finally, we give you some tips on integrating Selenium WebDriver with other popular tools and testing mobile applications. By the end of this book, you will have learned enough to solve complex testing issues on your own.
Table of Contents (21 chapters)
Selenium Testing Tools Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Developing a maintainable automation code is one of the keys to a successful test-automation project. Test-automation code should to be treated as production code, and similar standards and patterns should be applied while developing this code.

While developing Selenium WebDriver tests, we can use the Page Object model pattern. This pattern helps enhance the tests by making them highly maintainable, reducing the code duplication, building a layer of abstraction, and hiding the inner implementation from tests.

By applying object-oriented development principles, we can develop a class that serves as an interface to a web page in the application, modeling its properties and behavior. This helps in creating a layer of separation between the test code and the code specific to the page by hiding technical implementations such as locators used to identify elements on the page, layout, and so on. The Page Object design pattern provides an interface where a test can operate on that page...