Shula
Shula

Reputation: 306

DoubleClick speed in selenium

We have problem that doubleClick in selenium isn't working.

We are using Actions for perform doubleClick like appear here: Selenium webdriver Java code using web driver for double click a record in a grid.

After investigation and several attempts we found that it is related to the speed of the doubleClick. As you may know, speed of doubleClick can be change. Is there any option to set the speed of doubleClick in selenium?

Code used to perform the double click:

Actions actions = new Actions(webDriver);
actions.doubleClick(element).build().perform();

And we try without 'build' too:

Actions actions = new Actions(webDriver);
actions.doubleClick(element).perform();

Upvotes: 1

Views: 1213

Answers (2)

dank8
dank8

Reputation: 369

Alternative workaround described here

Simplified answer (change to needed element):

((JavascriptExecutor) driver).executeScript("document.getElementById('map_container').dispatchEvent(new Event('dblclick'));");

Upvotes: 0

NadeemZ
NadeemZ

Reputation: 1

As seems you are using customized timing for double-click in your application, i suggest to try use 2 separated clicks with wait same between them of same customized timing. i think it's easiest way to control timing between two clicks.

Upvotes: 0

Related Questions