
Type along with me to improve through practice and persistence while you learn Java, Selenium, TestNG, Maven, and Log4j2 techniques, with downloadable source code to add to your project.
Ask questions in the lecture Q&A to clarify content, and post your code using the formatting icon for easier debugging; email the instructor for updates if software fails.
Install three essential tools: JDK, IntelliJ IDEA, and Google Chrome to set up Java projects and automate with Selenium WebDriver.
Install Open JDK 11 on Windows 10, ensuring the installer sets JAVA_HOME and updates your PATH. Verify the setup with java -version and echo %JAVA_HOME%.
Install and start IntelliJ IDEA on Windows, choose the community edition, run the installer, set up shortcuts and path, reboot, and select the Darcula theme.
Download and install Google Chrome on Windows using the provided URL, accept the installation, run Chrome, and confirm a successful setup.
Install the java development kit on Ubuntu using OpenJDK 11, verify installation with javac -version and java -version, and confirm the runtime environment is installed.
Learn how to download from the JetBrains site and install IntelliJ IDEA community edition on Ubuntu, run the intellij-idea-community command, and apply the Darcula theme after accepting the user agreement.
Install Google Chrome on Ubuntu, either from the website or via the command line, by applying the provided key and repository commands, then test by typing google-chrome.
Install open jdk on mac by downloading open jdk 11 and running the installer. Set environment variables for JAVA_HOME and verify with java -version.
Download and install IntelliJ IDEA on Mac, choose the community edition, accept the user agreement, select the Darcula theme, and prepare to connect IntelliJ to the downloaded OpenJDK.
Download Google Chrome for Mac using the provided link, run the installer, launch Chrome, and set it as the default browser on your Mac.
Learn the architecture of Selenium WebDriver and complete the final setup steps for Java automation with TestNG. Download the introductory sheets in the resource section to guide the remaining configuration.
Explore how selenium web driver drives browsers natively like real users, across Windows, Mac, Linux, and Solaris, and understand its architecture: Java language bindings, JSON wire protocol, and Chrome driver.
Discover testNG, an open source automated testing framework for Java, where NG stands for next generation, designed to cover unit, functional, end-to-end, and integration tests and overcome JUnit limitations.
Download the Chrome driver from selenium.dev, ensuring the driver version matches your Chrome browser version, then open the zip and place the Chrome driver on your desktop.
Download the TestNG jar from the Maven repository for Windows, Linux, and Mac. Understand Maven repositories and prepare an IntelliJ project for coding in the next section.
Create a new IntelliJ Java project, ensure the OpenJDK is selected as the project SDK, name it GoldenFrameworkCourse, and place it in a new IntelliJProjects folder on your desktop.
Organize the project structure by establishing the maven layout: create src/main/java and src/main/resources, move and mark resources, and align directories with maven conventions.
Follow lowercase package naming to build a base structure: com.baturtestautomation.gtfcourse.lessons.java.seleniumandtestng and framework.seleniumeasy, with three sections you can start from and Maven conversion in the Maven section.
Add the Selenium WebDriver language bindings and the TestNG jar to your project, configure dependencies and libraries in the module, and prepare for Chrome driver setup to enable automation.
Learn to set up the Chrome driver for Java Selenium tests by configuring system properties, organizing resources, and handling cross-platform paths in a Maven project.
demonstrates setting up the gecko driver for Firefox and configuring driver paths across Windows, Linux, and Mac, plus guidance to set up other Selenium drivers.
Learn to start tests with a bigger browser window using Selenium Java, compare maximizing versus full screen, and validate by navigating to Google while applying driver window commands.
Explore the @Test annotation in TestNG with Java to define test methods, remove main methods, and run tests alphabetically, enabling driver reuse in your selenium-based framework.
Learn to use @before and @after test/method annotations—four additional annotations—to reuse the driver and control test execution.
Explore more @Before and @After annotations in the golden test framework with Java, Selenium, TestNG, Maven, and Log4j2. Learn before class, after class, before suite, and after suite execution order.
Learn to handle ad popups in automated tests by adding a close possible ad method in the manager class and invoking it after each URL to keep tests running.
Extend every new class from the manager to access the driver and its public fields, then verify test setup with before and after methods and a quick Google navigation.
Master Selenium locators and the Document Object Model (DOM) to locate web elements for automated testing. Use the find elements method with locator strategies to build reliable Selenium automation foundations.
Learn how to use the findElement(s) method and get an overview of selenium locators, with practical examples and a focus on css selectors for element search.
Learn to use Selenium WebDriver findElement(s) with locators, link text, partial link text, and tag name, to locate anchors and count anchor tags on a page.
Master the xpath syntax to create unique locators using absolute and relative paths. Explore wildcards, starts-with, and contains to build flexible element queries with examples.
Enhance selenium test automation by mastering xpath syntax, including absolute and relative locators, text function, and and/or conditions, plus navigating to child and parent elements.
Master css selector syntax to build locators using # for id and . for class, combine id and class for precision, and apply the attribute selector formula for a tag.
Demonstrates solving a find-elements exercise in a Java Selenium project by locating elements with ID, tag name, visible text, link text, partial link text, XPath, and table navigation.
Learn to automate clicks in a browser using selenium by locating elements with multi-attribute selectors. This lesson demonstrates clicking radio buttons and the get checked value button to validate selections.
practice clicking elements using the export locator on the radio button page, selecting the male radio, 15 to 50 radio, and the get values button, then watch the solution video.
Explore the solution for an exercise on clicking web elements using precise locators in a Java Selenium test, including radio buttons and the get values button, with result verification.
Learn how the getText method retrieves the visible inner text of web elements after interactions in a Selenium test, and prepare for assertions by validating console output.
Master the getAttribute method in Selenium to retrieve property values and attributes for elements, including checkboxes, and distinguish property values from attribute values to use these checks as checkpoints.
Explore how to use assert.fail in a Java Selenium TestNG workflow to validate test conditions, ensuring the total of a and b is a single digit with regex checks.
Explore the assert equals method in Java testing, comparing actual and expected values across strings, integers, and booleans; learn how failures show messages and how hard versus soft assertions behave.
Master assert true and assert false in Java tests by evaluating conditions such as a value equals six to pass or fail, with optional failure messages.
Compare hard asserts and soft asserts, and use soft asserts with assertAll to run multiple checks, such as inputs A and B and their total value, without early termination.
Learn to automate static dropdowns in a Java/Selenium setup by using the select class to choose options by visible text, by value, and by index, with test validations.
Practice selecting from static dropdowns with a hands-on exercise, using the attached PDF resource and a solution video to verify your work.
The video demonstrates solving a static dropdown exercise by locating the dropdown by id, selecting Friday via a select element, and validating the selection with equals and contains assertions.
Complete the form by typing, clicking elements, and selecting from a dropdown, then write three iterations with soft assertions to reinforce the page object model concepts.
Demonstrates solving a simple form exercise by locating inputs with css selectors, filling fields, selecting a state by visible text, and validating with assertions and a regex check.
Explore handling JavaScript alerts with Selenium WebDriver by working with simple, confirmation, and prompt alerts; switch to the alert, then accept, dismiss, or send keys.
Discover how to handle single and nested frames in Selenium by switching to frames by id, name, or index, and returning to the main content with default content.
Switch between browser windows by storing the main window handle, obtaining all window handles, and switching to the new window before returning to the main page.
Master handling a list of elements in Selenium by locating a list of web elements, iterating to click targets, and using the Page Object Model to reduce duplication.
Learn to automate auto suggestive dropdowns in Selenium with Java, using input fields, keyboard navigation, and highlighted list elements to reliably select a country from suggestions.
Learn to use the JavaScript executor in Selenium to interact with the DOM, locate and modify elements, send keys, retrieve values, and scroll the page.
Discover page object model design pattern, where each web page has a corresponding page class with elements and methods, separating automation from tests to improve maintainability and reduce code duplication.
Create a factory class to initialize web elements with the page factory pattern, using find-by annotations and locators for the input form submit page.
Centralize locator constants in a page object model to simplify element identification and maintenance as the ui changes.
Learn how to build a page class using a page factory, define element locators, and create typed interaction methods for form fields and dropdowns within a page object model.
Demonstrates implementing the page object model for a single-page application by organizing the user interface into panels and using constant, factory, and page clauses.
Create an enum to represent static dropdown options and implement overloaded selectors to choose by visible text, value, or index, then demonstrate in tests.
Download the Apache Maven 3.6.3 binary zip on Windows and extract it. Set the Maven home and update system path; Java is required, then verify with mvn -v.
Download and install Apache Maven on Linux and Mac, extract it to the desktop, locate the bin directory, export PATH, and verify the installation with mvn -v.
Convert the project to a Maven project by enabling Maven and adding dependencies. Configure groupId, artifactId, and version, then Maven downloads required plugins for Selenium tests.
Learn to manage Maven dependencies for Selenium and TestNG, configure the Maven compiler plugin, and set Java eleven, ensuring automatic dependency download from the local repository.
Finish the project structure by completing the test Java directories and creating packages in the test Java spec directory with a reversed domain name for automation, preparing the framework build.
Change the web driver setup by editing the manager class in the lessons part, removing three fields and letting WebDriverManager handle chrome driver setup, with options to disable auto updates.
Continue with the manager by enabling a maximized browser, adding implicit wait, setting the system under test url, and handling ad pop-ups with a try-catch to avoid failures.
Discover how to automate the home page by defining button locators, building a page object model with a factory, and automating clicks on basic, intermediate, and advanced buttons.
Build a centralized adjusted interactions tool in the Java Selenium framework to standardize element clicks with explicit waits, plan logging, and reduce duplicate code across pages.
Create and organize basic ui tests in the golden framework using java, selenium, testng, maven, and log4j2; implement home page tests for buttons, checkboxes, and data list filters.
Add the input form submit page to the automation framework by creating a new package, wiring constants and page objects, and implementing its tests and validations.
Create a new method for sending keys in the adjusted InterActions class that clears input fields when full, loops until empty, sends keystrokes, and logs actions.
Control test execution with a testng.xml file to selectively run regression tests in java selenium projects, configuring suites and including or excluding test cases for user interface and mobile testing.
Learn to pass parameters in TestNG using the parameters annotation and testng.xml, including a phone number and state, and drive browser selection (Chrome or Firefox) with optional parameters.
Use the data provider annotation to supply multiple test data sets by returning an array of objects, enabling repeated test executions with varied phone numbers and states.
Execute the testng.xml suite from the console by running mvn test, then integrate with Jenkins to trigger tests automatically at night and inspect the generated reports for pass/fail details.
Explore building automated screenshots in a java selenium test framework by adding a maven dependency, creating a screenshot utility, and saving named pngs with the driver, ready for failure scenarios.
Add a switch windows tool to the Java/Selenium/TestNG/Maven/Log4j2 framework, with methods to set the main window, switch to new windows, and return to the main window.
Implement and integrate an eye test listener to automatically handle test events, log results, customize reports, and capture screenshots on failure using a driver in a TestNG framework.
Learn to start logging with log4j2, print to the console, and use logging levels from trace to fatal; retrieve loggers and apply name conventions and basic configuration.
Configure log4j2 using a properties file to route logs to the console and a log file with a dynamic timestamp, using a pattern layout, level filtering, and package-specific logging.
Learn to add logging to a test framework by creating a private logger, initializing it in before suite, and logging info and debug messages for driver actions and test steps.
Configure log4j2 with an xml by adding log4j2.xml to the project resources and disabling the properties file, ensuring the logger uses the classpath and prints from trace to fatal.
In this course i will teach you to build a test framework with IntelliJ using Java, Selenium WebDriver, TestNG, Maven and Apache Log4j2.
The course is divided in to two parts.
The first part is the lessons part. In this part I will teach you the basics of selenium, testNG and the foundations of building our framework.
Once the foundations are set we can carry on to the second part.
In the second part we will build a test framework based on automating a real website.
The framework will be built according to the Page Object Model (POM) design pattern. The POM is a concept that is used a lot to automate multiple page applications. Here we segregate the automation from our tests. This makes the framework more maintainable. Your tests will also be easier to read and will be more script based. Even a collegue with less programming experience can create some tests in this framwork.
After this course you will be able to create a whole framework for automated testing of webapplications with all its necessary components.
I will also keep updating the course with new subjects in the future.
Here is a more detailed overview of the subjects i will teach:
- Enough Java knowledge to start automating
- Setting up the software needed
- Basic methods of Selenium WebDriver
- Some handy ChromeOptions
- HTML knowledge for automating web applications
- Finding elements with xpath and css
- Handle basic html elements such as dropdowns, inputfields, checkboxes,
frames, alerts, tables, lists, date pickers, switching windows, etc
- Creating handy tools with java such as a dynamic date formatter for your test cases
- Creating enums for static dropdowns and implementing them in the framework
- Integrating Maven after learning basics
- How to build a Page Object Model Designed framework
- Usage of different Assertions
- Difference between hard and soft assertions
- Implementing smart wait's
- Setup global properties file for usernames and passwords etc
- Take screenshots
- Using the JavaScript Executor
- Controlling test cases with the testNG xml
- TestNG Parameterization
- DataProvidor annotation
- Implement TestNG listeners
- Executing tests from the command line so we can link the project to a tool
for CI/CD (Continuous Integration / Continuous Delivery)
- Setting up log4j2 for logging with an xml and a properties file.
- Create new logging files after each test run
- Integrating all of above components in a working framework while teaching