Hands-On Selenium WebDriver with Java: A Deep Dive into the Development of End-to-End Tests
Book information
Description
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 Selenium (composed of WebDriver, Grid, and IDE) and its ecosystem. Discover why Selenium WebDriver is the de facto library 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 Copyright Table of Contents Foreword Preface Who Should Read This Book Why I Wrote This Book Navigating This Book Part I, Introduction Part II, The Selenium WebDriver API Part III, Advanced Concepts Conventions Used in This Book Using Code Examples O’Reilly Online Learning How to Contact Us Acknowledgments Part I. Introduction Chapter 1. A Primer on Selenium Selenium Core Components Selenium WebDriver Selenium Grid Selenium IDE Selenium Ecosystem Language Bindings Driver Managers Locator Tools Frameworks Browser Infrastructure Community Software Testing Fundamentals Levels of Testing Types of Testing Testing Methodologies Test Automation Tools Summary and Outlook Chapter 2. Preparing for Testing Requirements Java Virtual Machine Text Editor or IDE Browsers and Drivers Build Tools Optional Software Project Setup Project Layout Dependencies Hello World Using Additional Browsers Summary and Outlook Part II. The Selenium WebDriver API Chapter 3. WebDriver Fundamentals Basic WebDriver Usage WebDriver Creation WebDriver Methods Session Identifier WebDriver Disposal Locating WebElements The Document Object Model (DOM) WebElement Methods Location Strategies Finding Locators on a Web Page Compound Locators Relative Locators What Strategy Should You Use? Keyboard Actions File Uploading Range Sliders Mouse Actions Web Navigation Checkboxes and Radio Buttons User Gestures Right-Click and Double-Click Mouseover Drag and Drop Click and Hold Copy and Paste Waiting Strategies Implicit Wait Explicit Wait Fluent Wait Summary and Outlook Chapter 4. Browser-Agnostic Features Executing JavaScript Synchronous Scripts Pinned Scripts Asynchronous Scripts Timeouts Page Loading Timeout Script Loading Timeout Screenshots WebElement Screenshots Window Size and Position Browser History The Shadow DOM Cookies Dropdown Lists Data List Elements Navigation Targets Tabs and Windows Frames and Iframes Dialog Boxes Alerts, Confirms, and Prompts Modal Windows Web Storage Event Listeners WebDriver Exceptions Summary and Outlook Chapter 5. Browser-Specific Manipulation Browser Capabilities Headless Browser Page Loading Strategies Device Emulation Web Extensions Geolocation Notifications Browser Binary Web Proxies Log Gathering Get User Media Loading Insecure Pages Localization Incognito Edge in Internet Explorer Mode The Chrome DevTools Protocol CDP Selenium Wrappers CDP Raw Commands Location Context Web Authentication Print Page WebDriver BiDi Summary and Outlook Chapter 6. Remote WebDriver Selenium WebDriver Architecture Creation of RemoteWebDriver Objects RemoteWebDriver Constructor RemoteWebDriver Builder WebDriverManager Builder Selenium-Jupiter Selenium Grid Standalone Hub-nodes Fully Distributed Observability Configuration Cloud Providers Browsers in Docker Containers Docker Images for Selenium Grid Selenoid WebDriverManager Selenium-Jupiter Summary and Outlook Part III. Advanced Concepts Chapter 7. The Page Object Model (POM) Motivation The POM Design Pattern Page Objects Robust Page Objects Creating a Domain Specific Language (DSL) Page Factory Summary and Outlook Chapter 8. Testing Framework Specifics Parameterized Tests JUnit 4 TestNG JUnit 5 Selenium-Jupiter Cross-Browser Testing JUnit 4 TestNG JUnit 5 Selenium-Jupiter Categorizing and Filtering Tests JUnit 4 TestNG JUnit 5 Ordering Tests JUnit 4 TestNG JUnit 5 Selenium-Jupiter Failure Analysis JUnit 4 TestNG JUnit 5 Selenium-Jupiter Retrying Tests JUnit 4 TestNG JUnit 5 Selenium-Jupiter Parallel Test Execution Maven Gradle JUnit 4 TestNG JUnit 5 Test Listeners JUnit 4 TestNG JUnit 5 Disabled Tests JUnit 4 TestNG JUnit 5 Selenium-Jupiter Summary and Outlook Chapter 9. Third-Party Integrations File Download Using Browser-Specific Capabilities Using an HTTP Client Capture Network Traffic Nonfunctional Testing Performance Security Accessibility A/B Testing Fluent API Test Data Reporting Behavior Driven Development Web Frameworks Summary and Outlook Chapter 10. Beyond Selenium Mobile Apps Mobile Testing Appium REST Services REST Assured Alternatives to Selenium Cypress WebDriverIO TestCafe Puppeteer Playwright Summary and Final Remarks Appendix A. What’s New in Selenium 4 Selenium WebDriver Migration Guide Selenium Grid Selenium IDE Other Novelties Appendix B. Driver Management WebDriverManager: Automated Driver Management Generic Manager Advanced Configuration Other Uses Manual Driver Management Summary Appendix C. Examples Repository Setup Project Layout Maven Common Setup JUnit 4 JUnit 5 Selenium-Jupiter TestNG Other Dependencies Gradle JUnit 4 JUnit 5 Selenium-Jupiter TestNG Other Dependencies Logging GitHub Actions Dependabot Summary Index About the Author Colophon
Similar books
Mastering Software Testing with JUnit 5: Comprehensive guide to develop high quality Java applications
EPUB
Mastering Software Testing with JUnit 5: Comprehensive guide to develop high quality Java applications
2017 · EPUB
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF