Selenium WebDriver with Java - Basics to Advanced and Frameworks

Video description

Do you want to perform automation testing on website applications with Selenium and Java? This video course will help you build your knowledge of Selenium WebDriver by guiding you through the basics of Java. You will gain the confidence to perform automation testing on any web application. The topics range from basic to advanced levels, covering a variety of tips and tricks to help you progress.

The course starts with an introduction to Selenium and Java and delves into Selenium WebDriver and the Java concepts needed for manual testing and Selenium automation. Next, you will gain insights into functional testing with Selenium and execute browser testing, database testing, and performance testing on a Selenium script. You will also learn mobile testing basics and the latest features of Selenium 4.0.

As you advance, you will understand the framework design of TestNG, ANT, page object, Maven, Jenkins, Excel data-driven, Cucumber, and log4j. Toward the end, you will become familiar with core Java concepts, perform cloud testing with Selenium, and explore interview questions.

By the end of this course, you will have learned Selenium and be equipped with the skills you need to perform end-to-end automation testing for web applications.

What You Will Learn

  • Design hybrid automation frameworks from scratch
  • Gain knowledge of TestNG, Maven, Jenkins, Cucumber, and HTML reports
  • Handle a rich web user interface (UI) using advanced Selenium WebDriver
  • Automate any website over the Internet with all the possible test cases
  • Verify data integrity with the graphical user interface (GUI) of the application
  • Write the best-optimized code for automating test cases

Audience

If you are new to software development and testing or are an experienced manual tester who is looking to master Selenium to move into automation testing, then this course is for you. No prior experience in programming or Java coding is needed to get started on this course.

About The Author

Rahul Shetty: Rahul Shetty is the founder and trainer at Rahul Shetty Academy. He is a passionate software tester and has 13 years of rich experience in the IT industry. He has completed more than 300 offline training batches. Rahul has extensive knowledge in web automation testing, mobile automation testing, and API automation testing. He has also worked with various CMM-level organizations and managed the set-up of QA processes for projects.

Table of contents

  1. Chapter 1 : Selenium Introduction
    1. Course FAQs
    2. Selenium Features- What You Need to Know
    3. Selenium WebDriver Architecture Simplified
  2. Chapter 2 : Install Java and Selenium -Get Started with the Basic Steps of the Selenium WebDriver
    1. Install Java and Eclipse – Set Up Maven Project from Scratch
    2. How to Set JAVAHOME Path in MAC
    3. Understanding the Core Concept of Browser Driver Classes and WebDriver Interface
    4. How to Run Tests in Google Chrome and Importance of Chromedriver.exe file
    5. Troubleshooting Steps, If You Fail to Invoke Chrome Browser with Selenium
    6. Getting Started with Basic Selenium WebDriver Methods
    7. Update with the Latest Selenium Version - Selenium Manager (Beta)
    8. How to Run Tests in Firefox and Edge Browser with Gecko and Edge Drivers
    9. Running the Tests in Microsoft Edge Browser- Importance of Edge Driver
  3. Chapter 3 : Brush Up Java Concepts for Selenium Automation
    1. Course Strategy to Learn Java Basics for Selenium Automation
    2. Introduction to Java Variables and Data Types with Examples
    3. What Are Arrays in Java? How to Initialize and Retrieve the Values of Array
    4. Introduction to For Loop to Iterate over Array of Strings and Integers
    5. Enhanced for Loop Declaration and Using Conditional Statements Inside the Loops
    6. What Is Arraylist and Differences Between Arraylist and Arrays
    7. Iterating over Arrays and Arraylists and Its Related Methods
    8. Strings in Java - How to Declare Strings and Important String Methods
    9. How to Create Methods and Access Methods Using Java Class Objects
  4. Chapter 4 : Locator Techniques and Tools Used to Identify Objects
    1. Importance of Locators in Selenium WebDriver to Identify the Elements
    2. Identifying the Web Elements with ID and Name Locators with Example
    3. Introducing Class Name and CSS Selector Locators to Identify Elements
    4. Browser Plugins - Selectorshub to Identify and Validate the Elements on the Page
    5. Working with Xpath and linktext Locators and Different Ways of Writing xpaths
    6. Building Customized Xpath and CSS Selector Locators Based on HTML Attributes
    7. Generating xpaths with Parent to Child Tags Traverse Techniques
  5. Chapter 5 : Advanced Locators Identification and Interview Questions on Parsing Text
    1. Generating CSS Selectors Based on Regular Expressions - Example
    2. Identifying Web Elements Based on Unique Tag Name Locators - Example
    3. Generating xpaths Based on the Button Texts on the Page with the Example
    4. Parse the String with Java Methods to Get the Password Dynamically from the Page
    5. Running the Tests in Cross Browser and How to Inspect Objects in Edge and Firefox
    6. Identify Locators Using Siblings with Xpath Traverse - Example
    7. How to Traverse from Child Element to Parent Element with xpath - Example
    8. Automate Browser Navigations and Window Properties with Selenium WebDriver
  6. Chapter 6 : Selenium WebDriver - Techniques to Automate Web Elements
    1. Handling Static Dropdowns with Select WebDriver API
    2. Updated Lecture on Latest Dropdown Looping UI
    3. Handle Dynamic Dropdowns with WebDriver API
    4. Parent-Child Relationship Locator to Identify the Objects Uniquely
    5. Handling AutoSuggestive Dropdowns Using Selenium
    6. Handling Checkbox and Getting the Size of Them with Selenium
    7. Importance of Assertions in Automation Testing and How to Use Them
    8. Handling Calendar UI in Travel Websites Using Selenium
    9. Validating if UI Elements Are Disabled or Enabled with Attributes
    10. End-to-End Automation Using All UI Elements with Selenium
    11. Handling Java Alerts Using Selenium WebDriver
  7. Chapter 7 : Deep Dive into Functional Testing with Selenium
    1. Code Formatting and Debugging
    2. Problem - Adding Items to Cart for Ecommerce App
    3. Sending Array of Products to Cart for Checkout
    4. Building Programming Logic to Process Items in Array for Cart
    5. Debugging the Code to Understand How Flow Is Being Built
    6. Fixing the Problem of Inconsistent Locators and Making Tests Clean
  8. Chapter 8 : Synchronization Usage in Selenium WebDriver
    1. What Is Implicit Wait? Explain with Real-Time Scenario
    2. What Is Explicit Wait? Explain with Real-Time Scenario
    3. Scenario to Automate and Necessity of Waits in the Example
    4. Practical Examples of Implicit Wait
    5. Practical Examples of Explicit Waits
    6. What Is Fluent Wait and Its Advantages?
    7. Building Customized Methods Using Fluent Wait
    8. Practise Example on Fluent Wait
  9. Chapter 9 : Techniques to Automate Ajax Calls, Child Windows, and iframes
    1. Handling Ajax/Mouse Interactions
    2. Actions Class – Real-Time Example
    3. Window Handle Concepts – Real-Time Example
    4. Live Example on Working with Child Windows
    5. How to Handle Frames
    6. Frames Techniques – Real-Time Example
  10. Chapter 10 : Real-Time Exercises (End-to-End Programming)
    1. Practise Exercise- Print the Links Count in the Page
    2. Exercise 1.1 - Limiting WebDriver Scope
    3. How to Open the Links in Separate Tabs - Optimized Solution
    4. Getting the Titles of Child Tabs with Optimized While Loop
    5. Handling Calendar UI in Travel Websites
    6. Generic Method to Handle Calendar with Month and Date
    7. Solved Example on Calendar Methods
  11. Chapter 11 : Practical Problems and Methods to Handle Them with Selenium
    1. How to Perform Scrolling Within Table and Window Level Using JavaScriptExecutor
    2. How to Handle Table Grids in Webpage
    3. Parsing String and Comparing with Generated Sum Value -Exercise
  12. Chapter 12 : Miscellaneous Topics in Selenium WebDriver
    1. Handling HTTPS Certifications in Automated Browsers
    2. Explore Chrome Options to Set Proxies, Plugins, and Paths on Chrome Browser
    3. Maximizing Window and Deleting Cookies
    4. How to Take Screenshots in Selenium
    5. Strategy to Automate the Broken Links with Selenium
    6. Open Connection Method to Identify Status Codes of the Links
    7. Iterate over All Links in the Page to Validate Broken Links Mechanism
    8. Importance of Soft Assertions in Selenium WebDriver
  13. Chapter 13 : Selenium Java Streams - Automate Sort, Pagination, Filtering the Web Tables
    1. Important Note - Plan of Learning this Section
    2. Learn Everything about Java Streams
    3. Perform Web Table Sorting Using Selenium Java Streams
    4. Build Custom Selenium Methods Using Streams Mapper
    5. Automating Pagination Scenarios to Search the Data Using Do While Loop
    6. Filter the Web Table Using Selenium Java Streams
  14. Chapter 14 : Selenium 4.0 - Latest Features
    1. Introduction to Relative Locators
    2. Relative Locators with Real-Time Examples
    3. Invoking Multiple Windows/Tabs from Selenium
    4. Taking WebElement Partial Screenshot with Selenium
    5. Capturing Height and Width of WebElement for UX Validation
  15. Chapter 15 : Framework Part -1 - TestNG
    1. Why TestNG and Its Advantages
    2. Running Testcases in TestNG without Java Compiler
    3. Importance of xml File in TestNG Configuration
    4. Prioritizing the Testcases with TestNG
    5. Include and Exclude Mechanism to Control Testcases
    6. Executing the Testcases at Package Level with Regex
    7. TestNG Annotations Part - 1
    8. TestNG Annotations Part - 2
    9. Usage of Groups Functionality in TestNG
    10. Annotations Helper Attributes with Examples
    11. Parameterising from TestNG xml File
    12. DataProvider Annotation -Parameterizing Testcases - 1
    13. DataProvider Annotation -Parameterizing Testcases-2
    14. Listeners Interface in TestNG Framework
    15. Running Tests in Parallel and Generating Reports
  16. Chapter 16 : Framework Part 1 - Create Maven Project and Prepare Functional End-to-End Test
    1. FAQs about Framework Design - (Must Watch)
    2. Create New Maven Project and All Framework Dependencies
    3. Ecommerce Application Demo to Be Used in the Framework
    4. Selenium Program on WebDriverManager - Login- Get Products List
    5. Selenium Program to Retrieve Product and Add to Cart Based on Java Streams
    6. Implementation of Explicit Wait to Handle Application Synchronously on Loading
    7. Logic to Verify Items in the Cart with Streams and Checkout
    8. Wrapping Up End-to-End Automation Script on Purchasing Order in Ecommerce App
  17. Chapter 17 : Framework Part 2 - Design Pattern - Page Object and Factory Implementation
    1. What Is Page Object Model? Advantages of Its Implementation
    2. Creating Page Object Classes for Login Screen and Migrating the Test
    3. Implementing Action Methods for Page Factory Web Elements to Implement Logic
    4. Creating Abstract Components to Reuse the Common Methods/Code in framework
    5. Page Object Class Implementation for Product Catalogue Page and Update Test
    6. Speed Up Your Test Execution - Fix for Application Slowness in the Backend
    7. Creating Common Methods to Abstract Component and Extending It in Page Classes
    8. Wrapping Up the Whole Test with Complete Refactor into Page Object Model
  18. Chapter 18 : Framework Part 3 -Test Configuration Methods and Global Properties and Parallel Runs
    1. Creating Base Test Which Holds Common Test Configuration Methods
    2. Initialize Driver and Create Utility to Launch App with BeforeMethod Annotation
    3. Create New Error Validation Test as Per Framework Standards Developed Until Now
    4. Implement Test Strategy for Framework on How Tests Are Divided Based on Modules
    5. Create New Test Methods with Dependency Attribute Based on Test Strategy Design
    6. How to Run Tests/Classes in Parallel and Apply Groups Using TestNG.xml
  19. Chapter 19 : Framework Part 4 – Test Strategy- Control Tests Execution- Run Parallel Tests
    1. Agenda of Implementing Parameterization into Tests with TestNG Data Provider
    2. Integration of HashMap to Data Provider to Send the Data as One Hash Object
    3. How to Read the Data from JSON Files and Create the List of HashMaps for Testing
    4. How to Create Screenshot Utility in Base Test Class for Catching Failed Tests
  20. Chapter 20 : Framework Part 5 -Extent HTML Reports and TestNG Listeners and Thread Safe Execution
    1. What Are Extent Reports? Quick 30-Minute Tutorial
    2. Integrating Extent Reports to Existing Framework with the Help of TestNG Listeners
    3. Attaching Screenshot to Reports from Listeners on Automatic Test Failures
    4. Concurrency Problem -Implement ThreadLocal Class to Avoid Sync Issues in Tests
    5. IRetryAnalyzer to rerun the flaky failed Selenium tests in the framework
  21. Chapter 21 : Framework Part 6 - Test Execution from Maven and Integration with Jenkins CI/CD
    1. How to Run Tests in the Framework from Terminal Using Maven Commands
    2. Set Global Parameters Using Maven Commands and Update Tests at Runtime
    3. Install Jenkins in the Local System for CI/CD
    4. Integrate the Selenium Framework with Jenkins and Parameterize Jenkin Job
    5. How to Run Tests in Headless Mode and Integrate the Parameter in Jenkins
    6. Schedule Jenkin Jobs with Regular Expression and Trigger Nightly Automation Jobs
  22. Chapter 22 : Framework Part 7 - Integrating Cucumber Wrapper into Selenium Framework
    1. Important Note - How Much Cucumber Does This Course Cover?
    2. Introduction to Cucumber and Its Terminologies with Examples
    3. Setting Up Cucumber Dependencies into Framework and Creating Feature Files
    4. Implement Step Definitions for Features and Understand Regular Expressions
    5. Inject Selenium Code in Step Definition and Introduction to Tidy Gherkin Plugin
    6. Introduction to TestNG Test Runner to Run Cucumber Feature Files
    7. Control the Cucumber Feature Files Execution with Tags and Background Keywords
  23. Chapter 23 : Framework Part 8 - Common Selenium Framework OOPS Interview Questions
    1. Selenium Framework Interview Questions - Part 1
    2. Selenium Framework Interview Questions - Part 2
    3. Selenium Framework Architecture Diagram - Explained
  24. Chapter 24 : Understand Excel Data-Driven Testing Functions with Examples
    1. What Is Apache POI API and Download Instructions
    2. Strategy to Access Excel Data
    3. Getting Rows and Its Cells from Sheet
    4. Retrieving Data from Excel Based on Condition
    5. Practise Exercise- Excel Driven Testing -1
    6. Practise Exercise- Excel Driven Testing -2
    7. Practise Exercise- Excel Driven Testing -3
    8. Importance of DataProvider and Excel Integration for Better Data-Driven Building
    9. Understand DataProvider and How It Sends Data in Multidimensional Array
    10. Get Excel Dependencies and Connect from Java Code to Excel
    11. Live Demo on Integrating Excel to DataProvider to Parameterize Data
  25. Chapter 25 : Cross Browser Testing with Selenium Grid
    1. What Is Selenium Grid? Its Advantages on Bringing Down Execution Time
    2. Getting Started with Grid Infrastructure Setup - Create Components
    3. Create Node Physical Machines and Register with Grid-Check Grid Health
    4. Create Selenium TestNG Tests with Desired Capabilities and Remote WebDriver Class
    5. Demo on Executing the Selenium Scripts in Node Machines from Grid Hub
  26. Chapter 26 : Selenium 4 Chrome Dev tools Protocol (CDP) Integration Concepts
    1. What Are Chrome Dev Tools? Why Do We Need This for Selenium Testing?
    2. Understand Device Metrics Override Function to Simulate Browser As Mobile
    3. Importance of Execute CDP Command to Construct Your Own CDP Functions
    4. Localization Testing with Selenium 4 Using ChromeDevTools Protocols
    5. How to Extract Network Responses and Status Codes with Selenium CDP Listeners
    6. Intercept Network /API Responses with Selenium Chrome Dev Tools
    7. How to Test Failed Network Request Calls with Selenium CDP Commands
    8. Blocking Unwanted Network Request Calls to Speed Up the Execution with Selenium
    9. How to Emulate Network Speed with Selenium ChromeDevTools Integration
    10. Working with Basic Authentication Using Selenium uriPredicate Function
    11. How to Log JavaScript Errors from Selenium Script to Console for Debugging
  27. Chapter 27 : Database Connection to Selenium Testcases
    1. Steps to Connect Database to Selenium Testcases
    2. MySQL Download Instructions
    3. MySQL Server Connection Procedure
    4. Creating Database in MySQL Server
    5. Creating Tables in Databases
    6. Inserting Records into Table
    7. Integration of Database with JDBC API
    8. Steps to Connect Database Info to Selenium - 1
    9. Steps to Connect Database Info to Selenium - 2
  28. Chapter 28 : File Uploading (AUTO IT) and Downloading with Selenium
    1. Handling Window Authentication Pop-Ups with Selenium
    2. Examples on Handling Pop-Ups with Modified WebDriver URL
    3. What Is AutoIT? Installation Details
    4. Inspecting the Window Objects and Converting into AutoIT Code
    5. End-to-End Example on Uploading File with AutoIT Selenium
    6. Steps to Complete the Flow to Download File from Application with Selenium
    7. Chrome Driver Options to Configure Download Path of Browser
  29. Chapter 29 : Cross Browser Testing on Cloud Using Third-Party Vendors
    1. What Is Cross Browser Testing on Cloud? BrowserStack Support to Run Tests
    2. End-to-End Test Execution on Cloud with BrowserStack (Browser/OS Combinations)
  30. Chapter 30 : Git - Version Control Tutorial
    1. Introduction to Git
    2. Importance of GitHub and Its Uses
    3. Creating Git Config and Repositories
    4. How to Push Code to Remote Repository
    5. Understanding Staging and Commit in Git
    6. Add Remote Repository and Push the Committed Code
    7. End-to-End Working Example on Git Commands -1
    8. End-to-End Working Example on Git Commands -2
    9. Importance of Branching in Git
    10. How to Resolve Merge Conflicts with Git
  31. Chapter 31 : Maven - Build Management Tool In-Depth Information
    1. Importance of Maven in Framework Development
    2. Installing and Configuring Maven
    3. Creating Maven Project and Understanding Its Terminologies
    4. Understanding POM.xml File and Its Dependencies
    5. Importance of surefirePlugin in Executing Tests
    6. Integration of TestNG with Maven
    7. Switching the Tests with Maven Profiling
  32. Chapter 32 : Java OOPS Basics for Selenium Part -1
    1. Writing the First Executable Program in Java
    2. Usage of Methods in Java
    3. Importance of Classes and Objects in Java
    4. Two Ways of Defining a String Object – Important from an Interview Point of View
    5. String Class and their Methods
    6. Practise Exercise Reverse String Logic Palindrome
    7. If-Else Condition Usage in Java
    8. How For Loops Work - Example
    9. When Should I Use While Loop?
    10. How Do While Loop Works?
    11. Explanation on Nested For Loops
    12. Practise Exercise on Loops -1 (Printing Pyramid Triangle)
    13. Practise Exercise - 2- Yahoo Questions: (Inverted Sequence Pyramid Logic Program)
    14. What Is Interface?
    15. How Java Classes Can Take Advantage of Interfaces
    16. What Are Abstract Classes and How Different They Are from Interfaces
    17. Usage of Inheritance in Java
    18. Practical Examples on Types of Inheritances
    19. Explaining Function Overloading in Java with Example
    20. How Different Is Function Overriding from Overloading? - Explain
    21. What Are Arrays and Their Usage in Java Programs
    22. Ways of Initializing Arrays and Assigning Objects
    23. Logic Program on Multi-Dimensional Arrays
    24. Practise Exercise - Print Smallest Number in 3*3 Matrix
    25. Practise Exercise - Cisco Interview Question on Arrays
  33. Chapter 33 : Core Java Tutorial - Part 2
    1. Date Class Concepts
    2. working with Calendar Objects in Java
    3. How Constructor Plays a Crucial Role
    4. Types of Constructors and Their Usage
    5. What Is Super Keyword?
    6. Super Keyword Practical Usage
    7. Importance of This Keyword
    8. Static and Non-Static Importance in Java
    9. Final Keyword in Java
    10. Packages and Their Usage in OOPS
    11. Types of Packages and How They Will Help in Real Time
    12. Importance of Access Modifiers
    13. Difference Between Public and Private Modifiers with Examples
    14. Different Kind of Exceptions
    15. Try Catch Mechanism to Handle Exceptions
    16. Importance of Finally Block in Java
  34. Chapter 34 : Core Java Tutorial - Part 3 - Collections API
    1. What Are Java Collections?
    2. Implementation of Arrays List
    3. Examples of ArrayList
    4. Implementation of Set Interface
    5. Examples of HashSet Using Iterator
    6. Implementation of Map Interface
    7. Difference Between HashMap and HashTable (Interview)
    8. Practise Exercise: Printing Unique Number - Amazon Interview Question
  35. Chapter 35 : Cucumber Behaviour-Driven Data - Framework
    1. Advantages of BDD, Why It Is Getting Popular
  36. Chapter 36 : Bonus Lectures - Defect Tracking Tool
    1. Sample Application to Derive Test Cases
    2. Testcases Continued for the Ecommerce App
    3. Test Execution for All Test Cases and Update the Result Status
    4. Introduction to Bugzilla Tool and How to Create a Bug
    5. Adding More Details to Bug with Understanding of All the Fields

Product information

  • Title: Selenium WebDriver with Java - Basics to Advanced and Frameworks
  • Author(s): Rahul Shetty
  • Release date: January 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781789132908