Book Image

Selenium WebDriver Quick Start Guide

By : Pinakin Chaubal
Book Image

Selenium WebDriver Quick Start Guide

By: Pinakin Chaubal

Overview of this book

Selenium WebDriver is a platform-independent API for automating the testing of both browser and mobile applications. It is also a core technology in many other browser automation tools, APIs, and frameworks. This book will guide you through the WebDriver APIs that are used in automation tests. Chapter by chapter, we will construct the building blocks of a page object model framework as you learn about the required Java and Selenium methods and terminology. The book starts with an introduction to the same-origin policy, cross-site scripting dangers, and the Document Object Model (DOM). Moving ahead, we'll learn about XPath, which allows us to select items on a page, and how to design a customized XPath. After that, we will be creating singleton patterns and drivers. Then you will learn about synchronization and handling pop-up windows. You will see how to create a factory for browsers and understand command design patterns applicable to this area. At the end of the book, we tie all this together by creating a framework and implementing multi-browser testing with Selenium Grid.
Table of Contents (10 chapters)

Introducing Selenium WebDriver

Selenium WebDriver is used for automating web browsers by using the browser's internal plugins or dll with the individual browser drivers, which are available for each individual browser.

The following diagram shows the high-level functionality of Selenium WebDriver. The JSON API parses the instructions from languages like Java, Python, and so on, and invokes and operates on the concerned browser:

Class structure of Selenium WebDriver

The following diagram is a snapshot of the class structure of Selenium WebDriver. The WebDriver interface is the parent of Remote WebDriver, which is a public class. Drivers for Internet Explorer, Firefox, Chrome, and so on inherit from the Remote WebDriver. In future chapters, we will be digging deep into these drivers: