How To Automate Date Pickers | Playwright With TypeScript Tutorial ๐ญ| Part VII | LambdaTest
In this Part-VII of the Playwright tutorial series, ๐๐ค๐ช๐จ๐๐๐ ๐พ๐๐๐ฉ๐ฉ๐๐ง๐๐๐, Content Creator at LetCode (@Koushik_chat) teaches you how to handle date pickers in Playwright using different functions like Fill and Moment with the help of real-time examples.
0:00 Introduction
0:08 How to handle Date Pickers in Playwright?
0:46 Handling Date Pickers using the Fill method
4:59 Handling Date Pickers using the Moment method
29:16 Recap
30:07 Conclusion
Introduction to Date Pickers: The video starts by explaining the two types of date pickers commonly encountered in web applications. One displays dates in a "DD MMM YYYY" format with options to navigate months, while the other showcases only months and years for selection.
Handling Date Pickers in Playwright: The tutorial demonstrates two methods for interacting with date pickers using Playwright: The first method involves directly sending the date as text to the date picker input field. This approach requires understanding the expected date format by the date picker. The second method involves navigating the calendar widget to select a specific date manually. This includes using selectors to interact with the next and previous buttons and selecting the date from the calendar view.
Navigating Through Months: The presenter shows how to programmatically click the next or previous buttons to reach the desired month and year, highlighting the importance of correctly formatting the date to match the date picker's requirements.
Selecting Dates: Detailed instructions are provided on selecting specific dates within the calendar, including handling different calendar formats and ensuring the correct date is chosen according to the test scenario.
Using Moment.js for Date Comparisons: The video introduces Moment.js, a JavaScript library for parsing, validating, manipulating, and formatting dates, to simplify working with dates. The presenter uses Moment.js to compare dates and determine whether to navigate forward or backward in the calendar.
Writing Reusable Functions for Date Selection: Towards the end, the tutorial focuses on creating reusable functions for date selection in Playwright tests. This includes writing functions that take parameters like the date, month, and year, and using these functions to navigate and select dates in the date picker.
Practical Demonstration: Throughout the video, the presenter provides a hands-on demonstration by writing and executing Playwright test scripts that interact with date pickers in a sample web application. This includes live coding in Visual Studio Code and executing tests to verify the correct dates are selected.
How To Run Playwright Tests On LambdaTest Platform
How To Run Playwright Tests In Parallel
Migrate Existing Playwright Test Suites On LambdaTest
Run Local Tests Using Playwright
Running Playwright Tests With Playwright Test Runner
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.
An End To End Playwright Testing Tutorial | Playwright With TypeScript ๐ญ
Playwright with TypeScript TutorialCross Browser Testing On LambdaTest Cloud | Playwright With TypeScript Tutorial ๐ญ| Part XI
Playwright with TypeScript TutorialWhat Are Playwright Fixtures | Playwright With TypeScript Tutorial ๐ญ| Part X
Playwright with TypeScript TutorialPage Object Model In Playwright | Playwright With TypeScript Tutorial ๐ญ| Part IX
Playwright with TypeScript TutorialHow To Upload And Download Files | Playwright With TypeScript Tutorial ๐ญ| Part VIII
Playwright with TypeScript TutorialHow To Automate Date Pickers | Playwright With TypeScript Tutorial ๐ญ| Part VII
Playwright with TypeScript TutorialHow To Handle Frames And Windows | Playwright With TypeScript Tutorial ๐ญ| Part VI
Playwright with TypeScript TutorialHow To Handle Alerts And Dropdowns | Playwright With TypeScript Tutorial ๐ญ| Part V
Playwright with TypeScript TutorialHow To Handle Inputs And Buttons | Playwright With TypeScript Tutorial ๐ญ| Part IV
Playwright with TypeScript TutorialPlaywright Testing Features | Playwright With Typescript Tutorial๐ญ| Part III
Playwright with TypeScript TutorialHow To Use Functions And Selectors | Playwright With Typescript Tutorial๐ญ| Part II
Playwright with TypeScript Tutorial