Book Image

Selenium Testing Tools Cookbook Second Edition

By : UNMESH GUNDECHA
5 (1)
Book Image

Selenium Testing Tools Cookbook Second Edition

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 (16 chapters)
15
Index

What this book covers

Chapter 1, Getting Started, demonstrates how to set up Selenium WebDriver with Eclipse, Maven, or ANT for test development on a Java platform. Then it shows how to set up Visual Studio, Ruby, and Python for test development. This chapter also shows how to set up various browsers for testing.

Chapter 2, Finding Elements, introduces you to the locator techniques supported by Selenium WebDriver to find elements on pages in your web applications. Selenium WebDriver provides a number of techniques to find elements on web pages with multiple locator strategies such as XPath, CSS, and DOM. We can also implement custom locator strategies to locate elements. This chapter will also help you get started with the Selenium WebDriver locator API.

Chapter 3, Working with Elements, demonstrates how to use the Selenium WebDriver API to automate interaction with various types of UI elements used in web applications, including textboxes, buttons, dropdowns, radio buttons, checkboxes, and tables.

Chapter 4, Working with Selenium API, demonstrates how to use the Selenium WebDriver API to build tests. We will explore the API and investigate advanced user interactions to perform complex mouse and keyboard operations and work with various types of UI elements used in web applications.

Chapter 5, Synchronizing Tests, demonstrates how to use the Selenium WebDriver API to handle synchronization with implicit and explicit waits to implement robust and reliable tests.

Chapter 6, Working with Alerts, Frames and Windows, demonstrates how to handle multiple windows, pop-ups, and alerts that are displayed during test execution.

Chapter 7, Data-Driven Testing, introduces the data-driven testing approach—a widely used methodology in test automation. Selenium WebDriver does not have built-in features to support data-driven testing. However, we can extend the Selenium WebDriver API to support data-driven testing. This chapter covers recipes to support data-driven testing using JUnit, TestNG, and Apache POI to read data from spreadsheets.

Chapter 8, Using the Page Object Model, introduces the Page Object model pattern, which is widely used for structuring Selenium WebDriver tests. This chapter provides examples and tips on how to build testing frameworks using the Page Object model pattern.

Chapter 9, Extending Selenium, demonstrates how to extend the Selenium WebDriver API and add features to build a scalable test automation framework. This chapter covers some of the important recipes in extending Selenium WebDriver for various practical scenarios such as to support custom UI controls, capture images of elements, and perform image-based verifications.

Chapter 10, Testing HTML5 Web Applications, introduces you to using Selenium WebDriver to test web applications using the HTML5 standard. This chapter explains how to test video and canvas elements and the web storage API of HTML5.

Chapter 11, Behavior-Driven Development, introduces behavior-driven development with Selenium WebDriver, using tools such as Cucumber-JVM, SpecFlow.NET for .NET, Behave for Python, and Capybara for Ruby.

Chapter 12, Integration with Other Tools, demonstrates how to set up Selenium WebDriver with Jenkins to run tests in Continuous Integration using Maven and ANR. This chapter also covers recipes to use tools such as AutoIt and Sikuli to test non-web UI.

Chapter 13, Cross-Browser Testing, demonstrates how to set up a distributed test environment with Selenium Grid for cross-browser testing. We will add nodes with various browser and operating system combinations. We will run tests in parallel using TestNG, which helps to reduce the time of test execution and increases test coverage. This chapter also covers how to use cloud-based services, such as Sauce Labs and BrowserStack, for cross browser testing.

Chapter 14, Testing Applications on Mobile Browsers, introduces you to testing mobile web applications with the Apple iOS and Android platforms using Appium. This chapter covers recipes to configure and use Selenium WebDriver to test a mobile web application on iPhone and Android-based devices/simulators.