Testim Documentation

Welcome to the Testim documentation. You'll find comprehensive guides to help you get started quickly, example code snippets, and tips for being more productive. You will also find details about advanced features that allow you to customize Testim to fit your environment or special testing conditions. Don't worry, we'll support you if you get stuck. Let's jump right in!

Guides    Changelog

dblclick(selector [,options)


This is a TDK feature

This is not supported in Testim's visual editor

Double-clicks the given element on the screen, clicks on the element center by default.

  • selector {string | TDKStepLocator} a CSS selector or smart locator.
  • options {object} optional extra arguments
    • offset {object}:
      • x {number} x position in element to click in
      • y {number} y position in element to click in
  • returns: Promise which fulfills when the element matching selector has been double-clicked or rejected if the element is not found.

For example:

// ✅ double click on the first h1 on the page 
await dblclick('h1');
// ✅ double-click first h2 on the page with an offset 
await dblclick('h2', { offset: { x: 30, y: 30 }});
// ✅ double-click on the first login page button recorded
// as a smart locator 
await dblclick(l('login-button'));

// ❌ offset takes an object parameter
await dblclick('h2', { offset: 30 });
// ❌ need to pass a first parameter selector 
// or smart locator to know where to double click 
await dblclick();

Full Example

const { go, dblclick, test, text } = require('testim');
const expect = require('chai').expect;

test("dblclick", async () => {
    await go('http://jsbin.testim.io/xik/1');
    await dblclick('#mybutton');
    const dblclicked = await text('#mybutton');

Updated about a year ago

dblclick(selector [,options)

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.