
Set up a local e-commerce app, initialize the test project, and build a robust Selenium 4 framework with page object model, tagging, retrying, and remote Selenium grid testing.
Set up and run the jp store application by cloning the pet store project from GitHub, building the war file, and deploying to a local Tomcat server.
Install Docker on Windows by downloading Docker Desktop for Windows, meet Windows 10 64-bit Pro/Enterprise/Education requirements, restart to enable container features and verify with docker ps and docker run hello-world.
Install Docker Desktop on macOS by verifying hardware requirements, downloading the binary, signing into Docker Hub, and launching the application. Verify installation with docker --version and docker run hello-world.
Walk through the JPetStore demo, register and log in, browse products, add items to the cart, checkout with dummy data, view the health page, and review orders.
Download, extract, and organize all necessary browser drivers for Windows, including ChromeDriver, GeckoDriver, PhantomJS, Edge WebDriver, and IE driver, then add them to the system path and verify they run.
Download and unzip the macOS browser drivers (Chrome, Firefox, phantom), store them in a browsers folder, then add the folder to the path and verify access.
Create a new maven project, configure artifact coordinates and directories, and add JUnit 5 and Selenium dependencies along with surefire, allure, and maven compiler plugins for test execution and reporting.
In this lecture, set up the Selenium 4 project structure by creating packages for web driver, pages, steps, tags, and helpers, plus resources with data and drivers.
Create and execute your first selenium test with maven, configure ChromeDriver, and generate early reports using JUnit 5 annotations.
Configure allure to write results to target/allure-results by adding a property in the allure properties file, ensuring clean, fresh results with maven clean test, and generate the report under target.
Create a TestBase class to centralize setup and teardown in Selenium 4.0 JUnit 5 framework. Extend tests from this base to share the driver and avoid repeating initialization and cleanup.
Learn to assign meaningful display names to Selenium tests using JUnit 5 DisplayName and generators, including standard and replace underscores options, and understand precedence across method, class, and property levels.
Implement a property reader using the singleton design pattern with a private constructor, synchronised getInstance, and a volatile instance to read values from application properties for tests.
Store property keys as enum values to centralize strings and simplify refactoring; expose string values via a getter and use static imports in tests.
Learn to use WebDriverManager to auto-download and manage Chrome and Firefox executables, enabling seamless cross-browser testing with a property-driven switch between manager and local binaries.
Identifies design flaws in the test base, where driver creation and browser options are bundled together, causing static driver risks and flaky tests in parallel runs; proposes refactoring.
Design architecture for driver factory presents a setup with a browser type enum, setup interface for browser caps and options, and a driver manager handling initialization and cleanup with JUnit.
Create a driver setup interface for Selenium 4.0 with JUnit 5, defining methods to get browser capabilities, get browser options, and get web driver.
Create a browser type enum to manage Chrome and Firefox with a driver setup interface, building Chrome and Firefox options and capabilities for remote and local execution.
Create a thread-safe driver factory using ThreadLocal, with getDriver and quitDriver methods, an internal browser determiner from properties, and an enum of Chrome and Firefox that supplies browser-specific WebDriver configurations.
Create a driver manager class to handle setup and teardown of drivers in Selenium 4 JUnit 5, using before all, after all, before each, and after each with cookies cleanup.
Explore the page object model as a design pattern that centralizes UI locators. Reduce code duplication and simplify maintenance by updating a single page object's methods.
Walks through implementing a page object model in the project, defining a base page with common elements, and page-specific classes for login, dashboard, and products, plus a steps class.
Develop an HtmlPageObject class that uses By strategies (id, css, xpath, link text, etc.) with explicit waits and by-object overloads for single or multiple element retrieval.
Create a generic HtmlPageObject to interact with text boxes, buttons, links, dropdowns, and checkboxes using by locators or web elements, enabling enter, clear, click, get text, and verify page text.
Build a base page that centralizes common elements and metrics across login, dashboard, and product pages. Extend the page object for consistent navigation and interaction.
Continue building the base page by adding methods to click sign in, navigate the dashboard, access product and help pages, and support search and sign out with a category enum.
Build the login page object by modeling username, password, login button, and register link; implement a login method, navigate to registration, and retrieve invalid login messages using web elements.
Build an allure steps class to centralize page-object interactions, initialize pages once, and enrich test reports with steps like navigating the app and logging in with credentials.
Learn how to disable individual test methods or whole test classes using JUnit 5 annotations in the Selenium 4 framework, and compare per method and class level disabling.
Add hard and soft assertions to Selenium tests using JUnit 5, validate the dashboard greeting after login, and use soft assertions with lambdas to run multiple checks.
Organize nested test classes with the @Nested annotation in JUnit 5, validating invalid credentials and error messages while structuring tests under a parent login test.
Build account page objects in a Selenium 4 framework, implementing methods to enter user, account, and profile information, select by visible text, toggle checkboxes, and save to reach the dashboard.
Learn to create a user registration test that registers a new user, logs in, and verifies the welcome message, while avoiding hard-coded data with a fake data API.
Use the Java Faker API to replace hard-coded values with faker-generated data for user registration, creating a faker instance to populate names, emails, passwords, and addresses, and run Maven build.
Implement a public synchronized method to take a webpage screenshot, cast the driver to TakesScreenshot, obtain bytes, and attach the image to the Allure report, controlled by a screenshot property.
Learn to capture screenshots of a specific web element in selenium 4.0 with junit5, attach them to reports, and toggle element screenshots via a property.
Implement a JUnit 5 test listener to perform actions on test failure, success, or abort, using the extension context to access test details and capture screenshots.
Explore how to rerun flaky tests using the rerun Jupiter plugin in a Selenium 4 with JUnit 5 setup, including dependency installation, annotations, and guidance to investigate root causes.
Group tests by tags using JUnit 5 annotations, define tag constants, and run specific groups with Maven -D properties to execute smoke or regression tests.
Learn to enrich allure test steps by adding locator information using a log helper and a configurable switch, enabling detailed element and text interaction logs in selenium 4 with junit5.
Learn to drive parameterized testing in selenium 4 with JUnit 5 by reading user data from a CSV file and executing a registration test across multiple data rows.
Learn to implement data-driven tests with Apache POI by reading Excel data for Selenium 4 and JUnit 5. Build an Excel data reader that outputs a 2D array for tests.
Create a parameterized login test by reading username, password, and expected results from an Excel file with JUnit 5 method source, enabling multiple-user validation in a Selenium 4 framework.
Learn to execute tests in parallel with the Maven Surefire plugin, tuning parallel, thread count, and reuse/fork strategies for memory-efficient concurrency, with on-the-fly overrides via -D properties.
Explore implementing a system property helper to override Selenium test settings at runtime via mvn -D properties, enabling dynamic element screenshot control and on the fly configuration.
In the last few years, there has been a tremendous increase in the number of businesses that are now making it easier for consumers to do business online. Websites that can perform seamlessly on multiple browsers & platforms are necessary for a company to thrive & excel. So testing & automating the testing of these applications is essential for providing quality to customers who use these applications.
"The demand for engineers who have the niche skill of automating the testing of web,api & mobile application has increased."
"Selenium has been the most preferred library when it comes to automating UI tests."
Other than just automating a user workflow, it is also necessary to have the ability to execute tests multiple times with data, execute tests in parallel, group tests, run tests in Selenium Grid, capture screenshots, video recordings to provide additional information on test runs.
However, Selenium alone may not provide all the features to perform the activities as mentioned above. A combination of many libraries will be necessary to build a robust, effective & easy to use, reusable framework.
In this course, you will be learning exactly how to build a robust, simple, effective & reusable UI automation framework using Selenium 4, Junit5 & many other cool Java libraries.
Below are the features that we will be building into this framework
Dependency management & build execution using Maven
Property Reader using Singleton design pattern
Multiple browser binary management techniques using WebDriverManager
Robust Webdriver design with Threadlocal using FactoryPattern, using enums to manage browser configuration
Generic setup, teardown using junit5 annotations(@BeforeAll,@AfterAll,@BeforeEach,@AfterEach)
Implement the Page Object Model pattern to automate e-commerce application(JPetStore)
Creating generic element identification, element interaction & synchronization methods
Building steps for functionality using Allure Library(@Step)
Implementing Page & Element screenshots
Create TestListeners
Grouping of tests using tags(@Tag annotations)
Retrying flakey tests
Executing tests in parallel using maven-surefire(parallel & fork techniques)
Driving parameterized tests using excel & CSV
Implementing maven SystemPropertyVariables to override properties via command line
Creating awesome reports using the Allure Library.
Executing tests in Grid (Docker Selenium Grid, Zalenium Grid)
Source control with git & GitHub
Executing builds in Jenkins
"At the end of this course, you will master the techniques needed to build a robust, effective & easy to use, reusable framework. The knowledge learned will also help you with interviews."