Ultimate Selenium WebDriver for Test Automation 9788196994761

Elevate your test automation skills by mastering Selenium with Java, delving into advanced techniques for a comprehensiv

134 48 6MB

English Pages 369 Year 2024

Report DMCA / Copyright

DOWNLOAD FILE

Ultimate Selenium WebDriver for Test Automation
 9788196994761

Table of contents :
Cover Page
Title Page
Copyright Page
Dedication Page
Foreword
About the Author
About the Technical Reviewers
Acknowledgements
Preface
Errata
Table of Contents
1. Introduction to Selenium Test Automation
Introduction
Structure
Introduction to Selenium
Selenium: The Origin Story
Advantages of Selenium
Getting started with Selenium
Selenium IDE
Prerequisites
Test Automation using IDE
IDE Walkthrough
Debugging options
Command Palette
Target and Web elements
Additional Options
Conditional Logic
Exporting the code
Running on CLI
Key limitations and way forward
Conclusion
Exercise
2. Fundamentals of Test Automation
Introduction
Structure
Introduction to Quality
Software Testing
Supercharge your Quality Journey with Automation
Test Automation Strategy
Test Designing for Automation
Test Design Methodologies
Risk-Based testing
Pair-wise Testing
Test Execution and Logging
Logging
Importance of Logging
Reporting and Measurements
Test Automation Coverage
Conclusion
Exercise
3. Selenium WebDriver Basics
Introduction
Structure
WebDriver Architecture
Prerequisites
Setup and Basic Interaction
Locators and Web Elements
WebElement
Different Locator Strategies
Xpath Locators
Attributes
Axes
Operators
CSS locators
Interactions with Web Elements
click
isDisplayed
isEnabled
getAttribute
getText
sendKeys
clear
Handling Frames and Windows
iframes
Window Management
Common HTML Elements
Table
Select
Drag and Drop
Calendar
Form Submissions and File Uploads
Few Use Cases on Automation
Web Scraping for Fun
Automated Price Tracker
Virtual Plant Nurturer
Conclusion
Exercise
4. Advanced Selenium Techniques
Introduction
Structure
Synchronization and Wait Strategies
Waiting Strategies
Implicit Waits
Explicit Waits
Fluent Waits
Shadow DOM
Animations and moving elements
JavaScript Executor
Page Objects
Page Factory
Page Object limitations
ScreenPlay pattern
Comparison of Screenplay and Page Object Design Patterns
Page Object Pattern
Screenplay Pattern
Conclusion
Exercise
5. Test Automation Framework
Introduction
Structure
Framework Basics
Design Patterns
Factory Design Pattern
Single Responsibility Principle (SRP)
Reflection in Java
Maven
POM file
Directory Structure of a Maven Project
Maven Commands
TestNG
Installation
Annotations and their Execution Order
Running and Debugging TestNG tests
@Factory and @DataProvider
testng.xml and Parallel execution
Assertions
assertEquals
assertNotEquals
assertTrue
assertFalse
Test Reporting
Logging
Installation
Configuration
Log Levels
Building a Framework
Folder structure
Code smells
Building blocks of framework
WebDriver Factory Class
PageFactory Class
BaseTest Class
PageBase Class
Creating Automated Tests
Running tests via TestNG or Maven
Continuous Integration/Continuous Delivery
Benefits of CI/CD
Tools and Usage
Conclusion
Exercises
6. Distributed Test Automation
Introduction
Structure
Cross-browser Compatibility
Handling Browser-Specific Behaviors
Handling Chrome Browser Issues Using Selenium
ChromeOptions
ChromeDriverService
Certificates
Popups
Headless Mode
Mobile Emulation
Localization
Improve loading times
Selenium Grid
Setup and installation
Grid architecture
Roles of Selenium Grid
Standalone
Hub and Node
Fully distributed
Security
Conclusion
Exercise
7. SAAS and Non-functional Test Automation
Introduction
Structure
Basics of a SAAS Application
Dissecting Web Application Layers
Let’s Get Dissecting!
Test automation for SAAS
Test Pyramid
The Role of Non-Functional Testing
Limitations and Moving Forward
Performance Analysis
Installation
Test Authoring and execution
Security Testing
OWASP and ZAP
ZAP and Selenium
Setup and Pre-requisites
Conclusion
Exercise
8. BDD with Selenium
Introduction
Structure
Behavior Driven Development
Gherkin and Cucumber
Gherkin
Cucumber
Pre-requisites and installation
Feature file
Hooks
Step Definition
Runner
Cucumber properties file and reports
Tips for Cucumber
Conclusion
Exercise
9. New Features in Selenium 4
Introduction
Structure
History of Selenium (again)
Support for BiDi and CDP
Chrome DevTools Protocol
DOM mutation
Browsing Context
Console logs
Network Interception
Website Performance Metrics
Relative locators
Geolocation Emulation
Crucial updates
Conclusion
Exercise
10. Conclusion
Introduction
Structure
Test Maintenance
ROI for Test Automation
Extending Selenium with Excel
Apache POI Installation
Reading Values from Excel
Data-driven Frameworks
Keyword-driven Frameworks
Hybrid Frameworks
Bonus Components
Roadmap for Selenium
Conclusion
Exercise
11. Way Forward
Introduction
Structure
Usage of AI in Test Automation
Prompt Engineering
Impact of AI in the field of Test Automation
Git Basics
Key Concepts of Git
Essential Git Commands and their Usage
Git Workflow
Open-Source Community of Selenium
Technical Contributions
Beyond Tech: Enriching the Community in Varied Ways
Conclusion
Index

Polecaj historie