Menu

This is documentation for the next version of K6. For the latest stable release, go to the latest version.

Open source

dblclick([options])

Warning

Use locator.dblclick([options]) instead.

Mouse double clicks on the element.

ParameterTypeDefaultDescription
optionsobjectnullOptional parameters.
options.buttonstringleftThe mouse button (left, middle or right) to use during the action.
options.delaynumber0Milliseconds to wait between mousedown and mouseup.
options.forcebooleanfalseBypasses the actionability checks (visible, stable, enabled) if set to true.
options.modifiersstring[]nullAlt, Control, Meta or Shift modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.
options.noWaitAfterbooleanfalseIf set to true and a navigation occurs from performing this action, it doesn’t wait for it to complete.
options.positionobjectnullA point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.
options.position.xnumber0The x coordinate.
options.position.ynumber0The y coordinate.
options.timeoutnumber30000Maximum time in milliseconds. Passing 0 disables the timeout. The setDefaultTimeout option on BrowserContext or Page can override the default timeout.
options.trialbooleanfalsePerforms the actionability checks without performing the double click action if set to true.

Example

JavaScript
import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    browser: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();
  await page.goto('https://test.k6.io/browser.php');

  const elementHandle = await page.$('#counter-button');
  await elementHandle.dblclick();

  await page.close();
}