Get started with Selenium WebDriver, the open source library for automating tests to ensure your web application performs as expected. In this practical hands-on book, author Boni Garcia takes Java developers through Selenium's main features for automating web navigation, browser manipulation, web element interaction, and more, with ready-to-be-executed test examples.

You'll start by learning the core features of the Selenium framework (composed by WebDriver, Grid, and IDE) and its ecosystem. Discover why Selenium is the de facto framework for developing end-to-end tests on your web application. You'll explore ways to use advanced Selenium WebDriver features, including using web browsers in Docker containers or the DevTools protocol. Selenium WebDriver examples in this book are available on GitHub.

With this book, you'll learn how to:

  • Set up a Java project containing end-to-end tests that use Selenium WebDriver
  • Conduct automated interaction with web applications
  • Use strategies for managing browser-specific capabilities and cross-browser testing
  • Interact with web forms, manage pop-up messages, and execute JavaScript
  • Control remote browsers and use advanced browser infrastructure for Selenium WebDriver tests in the cloud
  • Model web pages using object-oriented classes to ease test maintenance and reduce code duplication

Table of Contents

  1. Preface
    1. Who Should Read This Book
    2. Why I Wrote This Book
    3. Navigating This Book
    4. Part I, Introduction
    5. Part II, The WebDriver API
    6. Part III, Advanced Concepts
    7. Conventions Used in This Book
    8. Using Code Examples
    9. O’Reilly Online Learning
    10. How to Contact Us
    11. Acknowledgments
  2. I. Introduction
  3. 1. A Primer on Selenium
    1. Selenium Core Projects
    2. Selenium WebDriver
    3. Selenium Grid
    4. Selenium IDE
    5. Selenium Ecosystem
    6. Language Bindings
    7. Driver Managers
    8. Locator Tools
    9. Frameworks
    10. Browser Infrastructure
    11. Community
    12. Software Testing Fundamentals
    13. Levels of Testing
    14. Types of Testing
    15. Testing Methodologies
    16. Test Automation Tools
    17. Summary and Outlook
  4. 2. Preparing for Testing
    1. Requirements
    2. Manual Driver Management
    3. Optional Software
    4. Examples Repository
    5. Dependencies
    6. Selenium WebDriver
    7. Automated Driver Management
    8. Unit Testing Frameworks
    9. Fluent Assertions
    10. Logging
    11. Project Setup
    12. Project Layout
    13. Dependencies Management
    14. Maven Configuration
    15. Gradle Configuration
    16. GitHub Actions Configuration
    17. Hello World
    18. Using Additional Browsers
    19. Summary and Outlook
  5. Index