Read more

How to doubleclick in Selenium

Dominik Schöler
February 10, 2014Software engineer at makandra GmbH

When removing the w3c option from Selenium, this workaround was deprecated. The working Monkeypacth would be session.driver.browser.action.double_click(self.native).perform, but Capybara Elements nowadays support the double_click method natively, so the Monkeypatch can be removed entirely!

Put the attached file into features/support/.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Example usage:

When /^I open the task named "(.+?)"$/ do |task_name|
  task = page.all('.task').detect do |t|
    t.find('.label').text.downcase == task_name.downcase
  end
  
  task.double_click
end

Note: only Selenium understands doubleclicks.\
Credits: the attached Capybara issue discussion.

Posted by Dominik Schöler to makandra dev (2014-02-10 17:23)