What this book covers
Chapter 1, Introducing WebDriver and WebElements, will start off with an overview of Selenium and it's features. Then, we quickly jump into WebDriver by describing how it perceives a web page. We will also look at what a WebDriver's WebElement is. Then, we
talk about locating WebElements on a web page and performing some basic actions on them.
Chapter 2, Using Java 8 Features with Selenium, will talk about prominent Java 8 features such as Streams API and Lambda expressions for processing the list of WebElements. The Stream API and Lambda expression help in applying functional
programming style to create readable and fluent tests.
Chapter 3, Exploring the Features of WebDriver, will talk about some advanced features of WebDriver, such as taking screenshots of web pages, executing JavaScript, handling cookies, and handling Windows and Frames.
Chapter 4, Exploring Advanced Interactions of WebDriver, will dive deeply into more advanced actions that WebDriver can perform on the WebElements of a web page, such as the dragging and dropping of elements from one frame of a page to another and right/context-clicking on WebElements. We're sure you will find this chapter interesting to read.
Chapter 5, Understanding WebDriver Events, will deal with the event-handling aspect of WebDriver. To state a few, events can be a value change on a WebElement, a browser backnavigation invocation, script execution completion, and so on. We will use these events to run accessibility and performance checks.
Chapter 6, Exploring RemoteWebDriver, will talk about using RemoteWebDriver and Selenium Standalone Server for executing tests on remote machines from your machine.You can use the RemoteWebDriver class to communicate with the Selenium Standalone Server on a remote machine to run commands on the desired browser installed on the remote machine. One of its popular use cases is browser compatibility testing.
Chapter 7, Setting up Selenium Grid, will talk about one important and interesting feature of Selenium named Selenium Grid. Using this, you can execute automated tests on a distributed computer network using Selenium Grid. We will configure a Hub and Nodes
for cross-browser testing. This also enables running tests in parallel and in a distributed architecture.
Chapter 8, Data-Driven Testing with TestNG, will talk about using the data-driven testing technique with TestNG. Using the data-driven testing approach, we can reuse a test with multiple sets of test data to gain additional coverage.
Chapter 9, Building a Scalable Selenium Test Driver Class for Web and Mobile Applications, shows users how to get started with designing and building the Selenium Framework driver class. This class is the engine that drives the browser and mobile applications. With Selenium WebDriver technology, users can test all the popular browsers and mobile devices using the same driver class and programming language. The Selenium WebDriver technology is platform independent and has various language bindings to support cross-browser and device testing in a single code base.
Chapter 10, Selenium Framework Utility Classes, describes how to design Java utility classes to support the framework components that are non-specific to any of the applications under test. Users will learn how to build classes to perform file I/O operations, data extraction, logging, synchronization, result processing, reporting, global variables, and many more.
Chapter 11, Best Practices for Building Selenium Page Object Classes, introduces users to designing and building application-specific classes following the Selenium Page Object Model. Users will be guided through designing abstract base classes, deriving sub-classes, and structuring classes to use common inheritance methods to ensure that page elements and methods are stored in central locations. In following these design principles, users will create an abstract separation layer between the page object and test classes in the framework.
Chapter 12, Defining WebDriver and AppiumDriver Page Object Elements, presents users with design techniques to ensure that elements are defined using best practices for locators, minimum number of elements defined in page object classes, how to build locators on the fly, and when to use static verses dynamic locators to test page object elements.
Chapter 13, Building a JSON Data Provider, explains how to design and build a TestNG DataProvider class using the JSON protocol to store data. The concept of data-driven test frameworks is introduced, and how to use a DataProvider to extract data on the fly to
ensure that standards for data encapsulation and DRY approaches are being followed is covered.
Chapter 14, Developing Data-Driven Test Classes, explores how to design data-driven test classes using the TestNG technologies. This includes TestNG features such as annotations, parameters, attributes, use of DataProviders in test classes, data extraction, exception handling, and setup/teardown techniques.
Chapter 15, Encapsulating Data in Data-Driven Testing, describes the use of encapsulation in data-driven testing. This will include JSON data manipulation, use of property files, processing JVM arguments, casting JSON data to Java objects, supporting multiple drivers, and parallel testing.
Chapter 16, Designing a Selenium Grid, presents the Selenium Grid Architecture, including designing a virtual grid in the Cloud, how to build the grid hub, browser nodes, and Appium mobile nodes, using the grid console, how to cast tests to the RemoteWebDriver,
and supporting third-party grids.
Chapter 17, Third-Party Tools and Plugins, details methodologies in using third-party tools and plugins in the Selenium Framework design. This will include the IntelliJ IDEA Selenium plugin, TestNG for results processing, the HTML Publisher Plugin, BrowserMob, ExtentReports, and Sauce Labs.
Chapter 18, Working Selenium WebDriver Framework Samples, provides users with a real working sample framework including Selenium driver and utility classes, page object base and subclasses, DataProvider class, data-driven test class, JSON data file, TestNG test IListener class, and ExtentReports IReporter classes. Users will be able to install the files in their own project, use the supplied Maven pom.xml file to pull down the required JAR files, and run the sample data-driven tests against a real practice website across multiple browser types.