
Build industry standard Selenium Java test frameworks from scratch, applying page object model, test data APIs, cookies for login, and scalable patterns including single responsibility principle and Java naming conventions.
Explore a flexible Selenium Java test framework built with a factory-driven driver setup, page object model, and reusable components, enabling API integration, data-driven tests, and cross-browser execution.
Learn to use Udemy features like Q&A, search and post questions to improve your learning experience. Adjust video resolution and playback speed, and understand rating prompts to optimize streaming.
Create a dedicated practice website to deliver the complete automation framework development experience, ensuring reliability, security, and API access for seamless learning.
Explore a full-featured e-commerce site to practice Selenium testing, including product search, filtering, add-to-cart, checkout, account management, and API-driven login and cookies.
Review the practice website guidelines for testing, including using dummy emails, limiting requests and threads, and handling tax and shipping rules for US and non-US regions, plus coupon scenarios.
Explore alternate practice websites for selenium automation, including a dummy e-commerce workflow with login, cart, and checkout, and notes on security and API-friendly elements.
Identify required software and jars to begin framework development, including Java JDK versions, an IDE, Selenium jars, a testing library, and Maven for automatic dependency management.
Install the Java JDK on Windows by downloading the Oracle JDK (Windows x64), running the setup wizard, configuring JAVA_HOME and PATH, and verifying with java -version.
Install and configure the IntelliJ community edition on Windows, create a Maven project with Java 16, and add Selenium and test dependencies in the pom.xml.
Install Eclipse and set up a Selenium Maven project, add Selenium and TestNG dependencies, create a test class under org.selenium using TestNG, and prepare for running tests with ChromeDriver.
Understand why test dependencies won't resolve in the main source set and how to switch scope from test to compile in the pom.xml, then refresh the Maven project.
Explore Selenium architecture by configuring the Chrome driver via system property, ensuring Chrome driver compatibility with your Chrome version, and launching a website through the web driver.
Set the driver executable path using the system PATH environment variable to avoid hard coding, ensuring cross-platform portability. Verify by running chrome driver and restarting the IDE.
Explore how selectors hub helps identify reliable CSS and XPath selectors for web elements, practice installing the extension, inspecting elements with devtools, and choosing unique, robust selectors.
Master Chrome dev tools to identify and optimize selectors with CSS and XPath, compare id, class, and attribute-based selectors, including substring, prefix, and suffix options, and validate unique elements.
Explore core Java object oriented programming concepts such as classes, methods, variables, constructors, strings, constants, enums, and static variables, along with control structures like switch, for, if-else, and for-each.
Explore Java basics using IntelliJ and Eclipse, create a Java project with a public package and camel case classes, and run a main method to verify exit code zero.
Explains Java basics including primitive and reference data types, variables, methods, constructors, static and non-static context, object creation, and constructor overloading illustrating polymorphism.
Explore the basics of the string data type in Java, defining, printing, and using methods like concat, substring, equals, equalsIgnoreCase, and parseInt.
Master basic Java control structures, including if-else, string comparisons, for and while loops, break and continue, and switch statements with enums for reliable value handling.
Explore how a subclass inherits methods and fields from a superclass using the extends keyword, enabling reuse. Understand how the super keyword differentiates same-named members and invokes the superclass constructor.
Explore how public, protected, private, and default access modifiers control class and member visibility, with practices like private attributes and public getters and setters, and use for constants and subclasses.
Explore encapsulation as the core OOP pillar, protecting class data with private attributes, accessed via public getters and setters, enabling read-only or write-only access and data hiding.
Explore polymorphism in object oriented programming, showing runtime polymorphism via method overriding and compile time polymorphism via method overloading, with inheritance, final and static method nuances, and practical salary examples.
Explore how abstraction hides implementation using abstract classes, enabling partial abstraction with abstract and regular methods. Learn inheritance, interface alternatives, and practical shape examples to illustrate area calculations.
Learn how 100% abstraction works with Java interfaces, which act as blueprints and require implementing classes, with default and static methods added in Java 8 illustrated by shapes.
Learn how to handle Java exceptions by distinguishing checked and unchecked errors, using try-catch, finally, and try-with-resources, throwing and printing stack traces, and defining user defined exceptions.
Perform file operations in Java using file reader, file input stream, file writer, and file output stream; create, read, write, close, and delete files and directories with os-agnostic, relative paths.
Execute the first test to diagnose a timeout when elements load after Ajax calls, and learn basic synchronization with waits, using thread.sleep to pause for server responses and verify elements.
Automate the second test by copying the first, logging in at checkout with direct bank transfer, entering billing details, and placing the order using Selenium Java test framework practices.
Fix and run second test by addressing timeout and element not interactable, remove thread.sleep, clear the email field, and convert tests from worst practices to a scalable Selenium Java framework.
Learn core automation principles, especially the less is more rule, creating atomic, independent tests with clear intention and self-contained state, while understanding variability and reliability factors.
Learn to design atomic tests that focus on a single intention, ensuring search, add to cart, and checkout validations remain independent and reduce test flakiness.
Learn how to reduce duplicate test code in selenium java by applying the dry principle, using page object model design, and creating atomic test cases to ease maintenance.
Identify and reduce duplicate element definitions across tests by adopting the page object model design pattern with separate page classes, boosting maintainability and scalability in Selenium Java test frameworks.
Explore how test cases fail when dependent on user state and default country, state, and payment method, and prevent this by selecting required fields or creating users programmatically.
Improve test readability by focusing on what is tested, not how. Remove selenium imports from tests and adopt a page object model with readable method names.
Remove duplicate driver initialization by moving setup and cleanup to a common method. Use test annotations to hide driver setup from tests, keeping focus on opening the home page.
Spot synchronization issues caused by thread.sleep for a fixed five seconds after API calls, and adopt Selenium implicit, explicit, or fluent waits for reliable tests across local and cloud environments.
Replace hardcoded test data by externalizing product names, user details, and billing addresses into a config file, XML, or JSON. Centralize updates to avoid changing multiple test cases.
Avoid hardcoded static text in Selenium Java tests by moving strings to XML, enabling dynamic, placeholder-based construction to validate checkout messages and confirm orders are created.
Enable multiple browser support in selenium java tests by switching from chrome to firefox or safari via system properties and maven, with a default browser as fallback.
Replace hardcoded chrome driver paths with environment variables to support multiple users and server environments, and rely on an automatic driver management library to stay compatible with browser updates.
In Selenium Java tests, prevent stale browser instances by ensuring the driver quits after each test via annotations, regardless of outcome, avoiding try-catch blocks.
Apply dry and single responsibility principle to create readable, maintainable, and scalable Selenium test automation. Embrace encapsulation, inheritance, and composition within the page object model for robust test frameworks.
Learn how the page object model encapsulates UI elements and actions to improve readability, reusability, and maintainability in test automation.
Create a base test with before and after method annotations to initialize and quit the driver for every test, using a driver manager and protected access for inheritance and encapsulation.
Create a base page in the POM structure with a private webdriver and parameterized constructor, adding common utilities like load page and take screenshot, while avoiding bloated base classes.
Create a home page object by extending the base page with a constructor that passes the driver to super, and define a private (later protected) store link element to click.
Use fluent interface in the page object model by returning the store page object after navigation, and choose between explicit objects or the builder pattern to balance coupling and readability.
Create the store page using page objects with proper initialization and fluent interface, naming elements like search field and add to cart button, and validate the title with assertion.
Master the builder pattern to chain store page actions, returning the same page after entering search text and clicking search, and navigate to the cart page when adding to cart.
Explore functional versus structural page objects in Selenium Java, showing how functional objects expose page functionality like search through a single method for tests.
Explore strategies to handle dynamic UI elements by generating locators at runtime, parameterizing product names, and exposing flexible page object methods for maintainable selenium tests.
implement a cart page by using the view cart link, navigate to the cart page, obtain the product name, and click checkout to reach the checkout page.
Create a checkout page as an exercise, exploring page object patterns, builder usage, and billing address objects. Learn using POJO, JSON, and Jackson for data-driven test cases.
craft descriptive test method names that reflect functionality, convert actions to functional page object methods, remove thread sleep, and improve readability of test cases.
Refactor the second test using page object model design, implement login flow with clear fields, and prepare your Selenium Java test framework for robust automation.
Learn to create a reusable load method that takes an endpoint to build the URL, plus use a fluent builder pattern to navigate to the store and search.
Create a billing address data object to encapsulate fields, convert methods to a functional page object, and reduce test maintenance when data changes.
Create a billing address pojo with private fields for first name, last name, address line one, city, postal code, and email, and auto generate getters and setters in IntelliJ.
Learn how to create and populate a billing address object, set its fields, and use a setBillingAddress method with a builder pattern in a Selenium Java test.
Apply the builder pattern to the billing address object by returning the address from setters, refactor the test case, and verify the test executes successfully.
Create a parameterized billing address constructor that assigns fields from parameters. Compare it with adding a default constructor for test flexibility, highlighting readability and footprint trade-offs.
Store test data in external JSON using Jackson for deserialization into Java objects, and create a billing address JSON in a Maven project with matching field names.
Add the Jackson data bind dependency to a Maven project by copying the dependency code from Maven Central into pom.xml, then refresh the Maven project to download and apply it.
Master Jackson deserialization by building a reusable utility to read JSON into a Java object using the Jackson object mapper, with a static generic method for billing address.
Make the read value method generic by using a type parameter, switch to string input, and call Jackson utils class statically to deserialize a Json file into a Java object.
Replace hard coded product data with a json array of existing products, using id and name to flexibly test any item, such as blue shoes (id 1215).
Create a product pojo with id and name fields matching the json and include constructors. Use Jackson to deserialize a products.json array, find by id, and use getters and setters.
Create a product object from json by its id, fetch the name, and remove hardcoding to enable data-driven tests with product, billing address objects, and a data provider.
Update the second test case to a functional billing address, create a user object from config, and use it in the test instead of hard coding.
Course Updates:
Nov 2023: The course fully supports latest Selenium version 4.15.0, latest Java 21, and latest versions of all supporting libraries.
*This course use Selenium 4.x.x for framework development*
Why this course?
Do you want to learn how real automation frameworks are built using Selenium by following 50+ industry best practices?
Did you learn Selenium in the past, but still figuring out how to go about developing a framework that is Readable, Maintainable and Scalable?
Is your team struggling with implementing automation frameworks that really works?
Did you learn many bad automation practices in the past that simply doesn't work and want to unlearn all those practices?
Then you are at the right place. This course is exactly what you were looking for!
I'll take you through an exciting journey of developing Selenium automation framework from scratch using a dedicated live e-commerce practice website!
I'll teach you 50+ industry best practices to follow while developing Selenium automation frameworks.
I'll teach you about design patterns and how to efficiently use OOP concepts in the framework.
I'll show you how to integrate APIs with the automation framework and use those to skip login through UI, to set the test data and to set the application state. All of these are Selenium recommended best practices.
I'll show you how to follow Single Responsibility Principle (SRP) and Do Not Repeat Yourself principle (DRY) which are a must while developing the framework
I'm VERY RESPONSIVE in the Q&A section. I respond to queries within 24 hours. If the time zone difference is not that huge, I can respond within 3-12 hours.
We will start with the bad practices first. This is what most of us do when we first start with developing automation frameworks.
Then I'll make you unlearn all these bad practices step-by-step by implementing many of the industry best practices using LIVE coding. I'll not only explain you the "what", but also the "why" and "how" while explaining each and every concept.
By the end of this course, you are surely going to be confident enough to build Selenium automation frameworks from scratch for any live website. You are going to think like an automation lead, plan and design the automation framework, write optimized and clean code and follow good programming and automation practices.
What topics are covered in this course?
MANY. Here's the list:
Setup the Maven project
How to automate tests using bad practices
Let's talk bad practices
Implement Page Object Model design
Create Data objects as Java Objects using POJOs
Synchronization [Wait] techniques and best practices
Optimizing tests
Implement Page Factory and discuss the Pros and Cons
Automatic driver management using WebDriverManager
Configure and drive framework using Maven
Support multiple browsers
Configure and drive framework using TestNG
Configure and drive framework using Maven and TestNG both
Implement Parallel execution using TestNG and Maven
Configure and drive framework using JUnit [specially for JUnit folks]
Parallel execution using JUnit [without ThreadLocal]
Implement Singleton Design Pattern for Config properties
How to support multiple test environments
Discuss issues with writing end to end tests
Convert to Atomic tests
Integrate APIs
Use APIs to inject cookies to browser and skip login through UI
Use APIs to set test data
Use APIs to set application state
Refactor tests to use APIs
TestNG Data Provider
Reuse Page Objects using Composition
Composition Vs Inheritance
Different ways to handle Parallel execution issues
Factory design pattern using Interface
Factory design pattern using Abstract class
How to take screenshot
How to take full page screenshot using AShot
When to use OOP concepts in automation frameworks
Allure Reporting and generate feature rich reports
Integrate the framework with GitHub
Auto-trigger automation from Jenkins using GitHub Web Hooks, SCM Polling and Build Frequency
Technology stack:
Selenium
Java
TestNG
JUnit
Maven
Rest Assured
Jackson Data bind API
Allure
GitHub
Jenkins
What else is included in the course?
All the code/notes used in the lectures are available for download
You will get my full support in the Q&A