Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

How to perform double click on an element in Selenium?

Category: Selenium WebDriver

We can perform double click on elements in Selenium with the help of Actions class. In order to perform the double click action we will use moveToElement() method, then use doubleClick() method. Finally use build().perform() to execute all the steps.

// doubleClick() method for double click to an element after moving to
      //element to with the moveToElement()
      Actions a = new Actions(driver);
      a.moveToElement(driver.findElement(By.xpath(“input[@type=’text’]))).
      doubleClick().
      build().perform();

Leave a Reply

Your email address will not be published. Required fields are marked *