Skip to content
CodeKruPro

Double Click and Right Click

56/70

Double Click and Right Click

Playwright supports advanced click actions:

  • locator.dblclick() — double click
  • locator.click({ button: 'right' }) — right click

On the Buttons page, #doubleClick responds to double-click and #rightClick responds to right-click.

Task:

  1. Navigate to https://testkru.com/Elements/Buttons
  2. Double-click #doubleClick and print its text after
  3. Right-click #rightClick and print its text after

Expected output:

After double-click: I was double-clicked!
After right-click: I was right-clicked!