Rayrun
← Back to videos

Click and Hold | Playwright Tutorial - Part 60

In this video, we'll discuss how to do the click and hold action using Playwright.

In this video tutorial, the host demonstrates how to perform a click and hold action using Playwright. The video starts with an introduction and then shows a use case where there is a button that responds to a click and hold event. The host clicks and holds the button to demonstrate the change in text.

The host explains that this kind of user interface is rare but can be found in older and some modern applications. The host discusses the importance of knowing how to perform a click and hold action in Selenium and introduces the Actions class and its clickAndHold function.

The host then presents two approaches to perform a click and hold action. The first approach involves using the mouse object and manually adding a delay with the pressDown and pressUp functions. The second approach, which the host finds simpler, is using Playwright's delay option within the click function.

The host shares the code written for the test case, which includes an assertion for the expected result of the click and hold action. The code is run and initially fails due to the absence of a delay. The host then adds a delay of three seconds using the delay option within the click function. The code is run again, and this time the test case passes.

The host concludes by mentioning that the tutorial was made based on a use case requested by a friend and hopes that it will be useful for viewers. The video ends with a call to subscribe for more videos on Playwright.

Overall, the video provides a quick and informative tutorial on how to perform a click and hold action using Playwright.

Related Videos

#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright - Set timeout, parallelisation and retries directly in your test files
Introduction to Playwright | What is Playwright test?
Introduction to Playwright | What is Playwright test?
Element Handle VS Locator API | Playwright Tutorial - Part 47
Element Handle VS Locator API | Playwright Tutorial - Part 47
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.