
Learn to automate modern web apps with Java Playwright through practical, hands-on lessons, covering dynamic elements, smart waiting, and test management with Juni.
Explore Playwright, the open-source Microsoft framework for modern web testing, supporting Chromium, Firefox, and WebKit, with parallel testing and cross-language bindings.
Learn Playwright architecture from the client library to the Node.js server and browser engines (Chromium, Firefox, WebKit), using a web socket protocol to navigate, click, and type with test assertions.
Set up your Playwright project by installing the JDK, choosing an IDE like IntelliJ, configuring Maven, and creating a Maven project with dependencies for Playwright and JUnit.
Set up a Java Playwright project with JUnit, add Maven dependencies to pom.xml, ensure the JDK is installed, and create the org love to code packages for main and test.
Learn to build your first Playwright test: initialize Playwright, launch Chromium (headless false), create a context and page, navigate, verify login heading, and close the browser.
Launch a first Playwright test in Java by starting chromium, maximizing the window, navigating to the love to code website, and verifying the login heading with XPath.
Write your first playwright JUnit test by launching chromium, navigating to the love to test site, clicking the authentication link, and verifying the login heading before closing the browser.
Create the first Playwright JUnit test in Java, using before/after hooks to set up the browser and page, navigate to the site, and verify the login heading.
Develop an end-to-end test workflow using Playwright and juni, featuring a reusable base test with before each and after each hooks, enabling clean browser lifecycle, inheritance, and scalable test code.
Create a final test class, move before each and after each logic into a framework base test, then extend the base test in the final test.
Explore locator strategies to uniquely identify elements for reliable Playwright tests. Learn role-based locators, test IDs, title locators, and selectors like labels, placeholders, texts, alt texts, CSS selectors, and XPath.
Create a locator strategies test in the ide that extends the base test and demonstrates locating elements by role, test id, label, text, alt text, title, css selector, and xpath.
Master browser navigation commands to load URLs, wait for pages, and simulate back, forward, and refresh actions for end-to-end test reliability.
Create a navigate commands test in Java Playwright, navigate to a URL, wait for it to load, then go back, go forward, or refresh, with debugging support.
Learn to highlight web elements during test execution with borders and colors, enabling real-time visibility, debugging locators, and reviewing failures with screenshots via JavaScript injected highlights.
Implement a highlight element method in the base test to visualize locators during debugging. Use xpath and css selectors to locate elements and verify highlighting improves debugging of web tests.
Master basic Playwright web element interactions: click, fill, type, clear, and visibility checks, to simulate real user behavior and validate a registration form.
Develop a Java Playwright test to interact with web elements on a registration form, filling full name and password, and validating the password must be at least six characters.
Navigate to the authentication page, fill the username and password with valid tata, click sign in, and verify the login success page using Playwright's recommended approach.
Practice exercise demonstrates building a Java Playwright test for an authentication form, filling credentials, validating login success, and logging out with heading checks.
Explore element information and its states, including attributes and css values, verify visibility, enabled, and checked states, and print results to the console during homepage and tabs page tests.
Retrieve element information and states using Java Playwright, including text, tag name, attributes, css values, and bounding box. Verify visibility, enabled, checked, editable, and hidden or disabled on page checkboxes.
Master dropdown handling in Playwright, including normal, multi-select, searchable, and select-and-add types, by navigating to the dropdown page and selecting by value, label, or index, with hover to open.
Master Java Playwright: handling dropdowns in test automation with single and multi select, by value, label, or index; work with searchable, add-option, and hover dropdowns in Playwright.
Handle JavaScript alerts in web tests by exploring simple, confirm, and prompt alerts, and practice triggering, switching to dialogs, and accepting or dismissing them with Playwright.
Develop and test alert handling in Java Playwright by navigating to the alerts page, locating elements with XPath, and validating simple, confirm, and prompt dialogues.
Learn to work with iframes in Playwright, switching to single and nested frames with frame locator, interacting with elements inside them, and returning to the main page.
Learn to automate iframe interactions in Java with Playwright, including switching to nested iframes, locating inputs, filling username and password, and verifying text on parent and inner pages.
Master shadow dom interactions in Playwright, including shadow host and shadow root concepts, navigating pages, clicking inside shadow dom, and handling nested iframes to enable dark mode and highlight headings.
Master shadow dom handling with java Playwright: navigate to the page, access nested shadow dom and iframe, locate and click the click me button, and toggle dark mode while highlighting.
Learn to handle tabs in playwright by switching between tabs, storing the original tab id, opening a new tab, waiting for load, and verifying the new tab's title before returning.
Learn to automate handling tabs with Playwright in Java: open a page in a new tab, switch between tabs, locate elements by data test attributes, verify headings, and log results.
Learn to manage browser windows and tabs in Playwright by switching between the original and new windows, waiting for load, and validating the new window's title and heading.
Explore browser window handling in Playwright by switching between the original and a new window, store original window id, wait for load state, verify title and heading, and switch back.
Learn to handle browser windows and tabs in Playwright, store original window, switch control to a new window, wait for load state, then verify the new window's title and heading.
Create a Java windows handling test that opens a new window from the home page, stores the original page, verifies the new window title and heading, then clicks check all.
Explore working with tables in web apps using Playwright, including locating tables, interacting with rows and columns, and validating or extracting data such as emails.
Create a Java table handling test that locates emails in a dynamic table, prints all email addresses, and iterates through table rows and columns using locators.
Learn how file upload transfers a local file by locating the input file element and uploading with set input files, and build portable relative paths for cross-machine Playwright tests.
Develop a Java Playwright file upload test by creating a test class, navigating to the upload page, and uploading files with absolute and relative paths using input file locators.
Learn to use playwright to capture screenshots during test execution for visual validation and evidence, including capturing the entire visual page and specific elements via page.screenshot with path options.
Develop and automate screenshot testing in Java Playwright, capturing homepage and heading screenshots, saving to target/screenshots, and logging results.
Master basic mouse actions for web test automation, including hover, right click, double click, and click and hold on AB testing and context menu pages.
Demonstrate basic mouse actions in java playwright tests, including hover, click, double click, click and hold, release, and right-click context menu interactions on AB testing pages.
Learn how Playwright's drag and drop actions simulate dragging a source element onto a target to test sortable lists and kanban boards, enabling precise reordering and UI interactions.
Create a Java Playwright drag-and-drop test by locating source and drop areas, using drag-and-drop actions to move apples and pineapple to drop area, then sort with click-and-hold and offset moves.
Learn to use the Playwright keyboard API to simulate keystrokes and shortcuts, typing characters, copying and pasting on authentication forms, and validating login workflows.
Automate keyboard actions in Java Playwright by creating a keyboard action test that navigates pages, types credentials, copies and pastes text, and submits the form.
Perform a registration form test by navigating to the user registration form, entering data, submitting, and verifying the registration success page and its details.
Practice exercise 2 builds a keyboard action test in java playwright: automate typing admin, copy-paste via keyboard, and submit the authentication form with debugging waits.
Learn how auto wait in Playwright automatically waits for an element to be ready before any action, handling dynamic content and printing visibility and text with a default 32-second timeout.
Java Playwright auto wait test by navigating to a dynamic element page, locating a tip element that appears after five seconds, and verifying visibility and text content.
Learn how explicit waits in Playwright pause test execution until a targeted element condition is met, using wait for selector, url, load, and network events to handle dynamic content.
Master explicit wait in Java Playwright to handle dynamic elements by configuring timeouts and using wait for selector with locator actions.
Explore Playwright launch options to configure headless and GUI modes, incognito contexts, SSL handling, viewport sizing, and disabling extensions, popups, and notifications for automated testing and CI/CD pipelines.
Learn to configure Playwright browser launch options, including headless mode, start maximized, window size, ignore certificate errors, and ssl handling, then test navigation to an expired bad ssl site.
Master cookies in playwright by learning how to manage session state with context cookies, including authentication and shopping cart values, retrieve and apply cookies to a session, then delete them.
Master cookie handling in Java Playwright by coding tests that get, add, and delete cookies across browser contexts, including toggling themes and refreshing pages.
Explore cross browser testing with Playwright, verifying data and ensuring the web app functions consistently across Chrome, Firefox, Edge, and Safari, while validating UI, responsiveness, and rendering.
perform cross browser testing with Firefox using Playwright in Java, launch Firefox, navigate to automation practice site, wait for h1 heading, print page title, and close browser.
Learn to perform cross-browser testing with Playwright by launching Edge, configuring Chromium launch options, and validating elements on the practice site, then run and close the Edge session.
Learn to implement cross-browser testing in Playwright by creating a safari launch test, launching webkit, and running it to verify safari browser automation.
Master CSS selectors as a fast, reliable way to locate HTML elements. Learn strategies by tag, id, class, and attributes, including direct child, descendant, and sibling relationships, versus XPath.
Master CSS selectors for web test automation in Java Playwright, covering tag, id, class, and attribute selectors, plus contains, starts with, and descendant and sibling patterns.
Explore XPath as a powerful Playwright locator using XML paths to navigate up and down the DOM, enabling text-based and attribute-based element selection with varied strategies.
Discover how to craft robust XPath locators in Java Playwright tests, using tag name, id, class, and attribute strategies, plus contains, starts-with, text, and sibling and indexing patterns.
Master advanced XPath strategies to locate elements in dynamic or deeply nested structures, navigate up and sideways, and use text content, indexing, substring, and normalized space when css fails.
Master advanced XPath techniques to locate web elements in Playwright tests, using parent, ancestor, contains, text, and logical conditions, while comparing with CSS selectors and page locators.
Master dynamic locator strategies in Java Playwright by using partial XPath to handle dynamically generated IDs, locate dynamic elements, click to reveal content, and verify the content.
Create a dynamic locator test in java, implement an xpath that matches a button by starts with its id, and verify dynamic content after clicking.
Learn to perform native click in Playwright using JavaScript evaluate to trigger clicks directly, bypassing not-clickable issues on dynamic id buttons, and verify the success message.
Develop a native click test in Java Playwright to handle dynamic locator issues, click a dynamic id button by evaluating the element, and verify that the dynamic content is visible.
Use Playwright to scroll to element, bringing it into view to bypass visibility issues, click the about link on the homepage, and verify the about page heading.
Practice a scroll to element test in Java Playwright by locating the about link, scrolling into view, clicking, and verifying the heading on the automation practice site.
Learn how retry logic strengthens Playwright tests by handling intermittent failures with live locators, refreshing pages, and up to three attempts to click the authentication link.
Demonstrates retry logic in a Playwright test using Java for authentication link clicks. Includes locating the locator, up to three attempts, and logging retries for robust test automation.
Identify broken images with Playwright by checking image URLs and API response codes, then count images and flag those with status 400 or higher.
Develop a broken images test in java playwright, navigate to the broken images page, collect image urls from img tags, and verify responses with a request context.
Identify and verify broken links on a webpage by extracting urls and checking api response codes with Playwright, classifying results by status 400 or higher.
Develop a Java broken links test in Playwright by locating all anchor tags on the homepage, collecting hrefs, and validating that each link returns status 200.
Explore tracing and video recording in Playwright, capturing network requests, logs, screenshots, and state actions to debug tests, and automatically record a test run video for visual replay.
Configure tracing and video recording in Playwright to capture screenshots, snapshots, and sources during tests. Save traces and videos for debugging with the trace viewer.
Explore geolocation and device emulation in Playwright by simulating a user's location and mimicking devices to test location-based content and responsive design.
Launch a Java playwright session to test geolocation and device emulation on a mobile viewport, with San Francisco geolocation, 390x844 viewport, and ismo true; verify login heading after authentication.
Learn to use Playwright Inspector and slowmo to debug tests, pause execution, inspect elements, and observe authentication or registration flows as you slow down and step through each action.
Use Playwright debugging tools in Java to inspect, slow down, and record tests, generating assertions and leveraging inspector, code generator, and batch execution for debugging complex forms.
Master full page screenshots with Playwright across browsers for visual validation, capturing the entire page, saving to target/screenshot location, and verifying the saved path.
Develop and run a full page screenshot test in the IDE by extending a past test class, configuring full page capture, and saving the homepage screenshot to a path.
Set up JUnit, the Java unit testing framework, to write repeatable automated tests with annotations like @Test, @BeforeEach, and @AfterEach, enable parallel testing, parameterized testing, reporting, and configure via pom.xml.
Set up JUnit in your Maven project by editing the pom.xml, adding JUnit 5 dependencies and plugin, configuring terminal test includes, and running mvn test to execute tests.
Learn to write JUnit tests in Java, annotate methods with @Test, and control execution order with order values and display names. Compare alpha-by-method-name ordering and observe the console.
Develop and run JUnit tests in a Java project, create test methods for open application, login, and logout, and control execution order using method order annotations and display names.
Explore JUnit annotations and the test lifecycle, including before all, before each, after each, and after all, with setup, teardown, parameterized tests, and value source.
Learn how to use annotations and the test lifecycle in JUnit to set up, run, and tear down tests with before all, before each, after each, and after all.
Master JUnit assertions as validation checkpoints that compare expected and actual results, using assert equal, not equal, true, false, null, not null, and assert all.
Apply practical JUnit assertions in a Java test class, including assertEquals, assertNotEquals, assertTrue, assertFalse, assertNull, assertNotNull, assertSame, and assertNotSame, with examples of messages for debugging and soft assertions.
Create a Java Playwright registration form test, introduce dynamic expected values, and assert actual name, email, and phone using page locators and inner text.
Explore parameterized testing to run the same test with different input data, avoiding hard-coded values and enabling data-driven tests using value source, csv source, csv file source, and method source.
Develop parameterized tests in Java using JUnit Jupiter, leveraging value source, CSV source, and CSV file source to run login tests for multiple users.
Build parameterized tests using method source and anum source to inject login data from a data provider, including a static stream of arguments and multiple user credentials.
Explore how JUnit reporting produces test execution results, generates and views Maven Surefire reports in the target folder, and shares results for debugging and CI/CD integration.
Configure the maven surefire report plugin, run mvn clean test to generate a JUnit unit report, and share 63 tests, 3 errors, and 95.2% success with your team.
Explore how JUnit extensions hook into the test lifecycle to run custom logic before and after tests, on failure, and on exceptions, enabling logging, retries, and conditional execution.
Develop a JUnit logging extension in Java, implementing before and after test execution callbacks, including test finished, test successful, and test failed, and apply it to your tests.
Discover how an automation framework serves as a reusable blueprint for test scripts, enhancing maintainability, readability, and reporting within the Java Playwright JUnit project structure.
Create a structured test framework by organizing packages for constants, extensions, pages, utils, and config, laying the foundation for page objects and test data in Java Playwright.
Explore the page object model in Playwright, where each page is a Java class with locators and actions, enabling reusable, maintainable, and readable tests by separating UI details from logic.
Explore pom-based test automation in Java by building a base page, homepage, and registration page, using reusable click and type methods to verify the registration form and submission.
Explore the core oop concepts—inheritance, encapsulation, polymorphism, and abstraction—and see how they drive modular, reusable frameworks with a base test class, page classes, and logging.
Explore oops concepts in automation frameworks by examining inheritance for test setup and page reuse, polymorphism, encapsulation, and abstraction through Playwright's multi-browser interface.
Create a test data constants file in the Java web test framework to centralize base URL, authentication URLs, and login credentials (admin and wrong credentials) for robust test automation.
Move the JUnit listener into the framework using the logging extension, extend test classes with the extension, and run the authentication test in chrome to see logs and failure screenshots.
Learn to read configuration data from a properties file with a util class, and launch browsers based on the browser key (Firefox or Chrome) defined in config.properties.
Create a wait time utility in Java to centralize time management in an automation framework, with duration values and methods to obtain seconds and millis, used in base tests.
Demonstrates highlighting web elements in an automation framework by adding a should be displayed method, toggled via a debug property, and applied to registration form headings.
Add logs and measure locating time in the registration test within a Playwright-based automation framework. Use wait for to verify element visibility and print duration in milliseconds.
Are you ready to kickstart or accelerate your career in test automation and modern software development?
This course is your complete guide to mastering web test automation, UI testing, and end-to-end testing (E2E) using Java Playwright. You will learn how to build modern test automation frameworks with Playwright in Java and apply them to real-world projects.
Whether you're a developer looking to build robust automated tests or a manual tester aiming to transition into automation, this course is designed to take you there step by step.
We begin with the fundamentals of Playwright Java and quickly move into advanced concepts such as cross-browser testing, framework design, and data-driven automation. You will gain hands-on experience with real-world projects that mirror what you will encounter in the workplace. You will test modern web applications, including forms, navigation flows, and real user interactions.
You will start writing automated tests early in the course and build your skills step by step.
In today’s AI-driven world, more code is being generated automatically. That makes test automation an essential skill. You will learn how to build automation tests that validate generated code and catch issues early before they reach production.
You will also learn how developers use Playwright for Java for integration testing and end-to-end testing, along with best practices for structuring test code, managing test data, and building scalable, maintainable automation frameworks using Maven.
By the end of this course, you will have built a complete Java Playwright automation framework that you can use in your own projects, add to your resume, or showcase to employers.
Learn from an experienced instructor with a proven track record of teaching Java and Spring development to hundreds of thousands of students worldwide.
What Makes This Course Unique
Start from Zero: No programming experience required
Real-World Projects: Build automation frameworks used in industry
Modern Stack: Java, Playwright, Maven, and best practices
Step-by-Step Teaching: Clear explanations with hands-on coding
Developer-Friendly Approach: Learn how to integrate Playwright into real-world Java applications
Instructor Support: Fast, detailed help in Q&A
Who This Course Is For
Developers who want to add automated testing to their skill set
Manual testers looking to move into automation
QA professionals preparing for Playwright-based roles
Beginners with no programming background
Anyone transitioning into test automation
Everything You Need Is Included
Full source code for all projects
Downloadable PDFs for every lecture
Student Praise from My Other Courses
“Best structure and teaching method I've ever seen. You make every concept easy to understand.” – Dave Z.
“The best Java instructor on Udemy. Bar none.” – Muzi P.
“Real-world, industry-ready examples. Worth every penny.” – Premang
“You are the gold standard for teaching software development.” – Julie H.
Join 900,000+ Java developers already learning with me on Udemy.
Let’s master web test automation with Playwright together and take your coding skills to the next level.
Tools & Technologies
Java 26+ (works with Java 17+)
IntelliJ IDEA (free version)
Maven (for dependency management)
Java Versions Covered
Java 26
We are Responsive Instructors
Got a question? We respond to all questions within 24 hours.
You're never learning alone. We're here to help you every step of the way.
Start building modern, production-ready test automation frameworks with Java and Playwright today.