Playwright Java Tutorial π | How To Run Your First Playwright Test | Part II
In this Part 2 of the Playwright Java tutorial series, Koushik Chatterjee(@Koushik_chat), Content Creator at LetCode deeps dive into running first Playwright tests by launching different browsers like Chromium, Firefox, and WebKit. By the end of this video, you will be able to use different locator strategies and assertion mechanisms while automating your first Playwright test.
00:00 Introduction
02:00 Create Maven project
03:15 Add Maven dependencies
06:15 How to launch browsers?
09:29 Navigate to a site
10:23 Run on head mode
10:57 Login test scenario
12:05 How to find a locator?
12:46 Mouse hover
13:28 Click action
14:17 Assertion
15:21 GetByLocator
18:54 Close
20:32 Run in multiple browsers
21:57 Recap
Introduction to Playwright Codegen: The video begins by introducing Playwright's code generation feature, codegen, which allows users to automatically generate test scripts by recording their interactions with a web application. This feature is designed to help users quickly bootstrap tests without manually writing the initial boilerplate code.
Generating Test Code: The tutorial demonstrates how to use the Playwright CLI to start a codegen session, guiding viewers through the process of recording a sequence of browser interactions and then generating the corresponding Playwright test code. This section emphasizes the efficiency and ease of creating test scripts with codegen.
Recording Test Execution as Video: The video explains how Playwright can record test executions in video format, providing a visual representation of the test run. This feature is valuable for debugging, sharing test executions with team members, or reviewing test outcomes.
Setting Video Size: It also covers how to configure the size of the video recordings, ensuring that the videos meet specific requirements for quality or file size.
Practical Demonstration: Throughout the video, the presenter provides a hands-on demonstration of using codegen to generate test code for a sample web application and then running the tests with video recording enabled. This practical approach helps viewers understand the application of concepts in real testing scenarios.
Recap of Learning Points: The video concludes with a recap of the main topics covered, reinforcing the learning points and ensuring viewers have a clear understanding of how to use Playwright's code generation and video recording features effectively.
Playwright vs Selenium vs Cypress: A Detailed Comparison
Playwright Tutorial: Getting Started With Playwright Framework
How To Find Elements Using Playwright Locators
A Complete Guide To Playwright Assertions
Koushik Chatterjee
Koushik is a seasoned Senior Software Analyst at TVS Next. In his role, Koushik collaborates with a dedicated team of software engineers and testers, leveraging his expertise to craft and deliver high-quality software solutions tailored for diverse clients. Specializing in testing tools and QA automation techniques, Koushik meticulously ensures the functionality, performance, and security of software products.