Double click in Selenium:

 

  • Double click involves clicking on your mouse button twice to make a double click, and not just two clicks, in a short time the mouse button should be pressed twice, usually around half a second.
  • Used to do double-clicking to do different things, such as opening a program, opening a folder or choosing a word of text.
  • It double click on the current mouse position.

 

Scenario’s to Perform Double Click on WebElement:

  • in-Built doubleClick Method exist in Action Class.
  • We Perform Double Click operation using Action Class.
  • Create Instance / Object of Action class.
  • findElement where we want perform Double Click operation.
  • Store findElement into WebElement.
  • Using in-Built doubleClick method perform Double Click operation on WebElement.

 

Double click on WebElement:

 

Package import to Create a Instance of Action Class:

  • After create instance of Action Class we handle multiple Methods such as clickAndHold(), contextClick(), doubleClick(), dragAndDrop(source, destination), keyDown(modifier_key), keyUp(modifier_key), moveToElement(destination_Element), release() etc…

 

Step’s to Perform Double Click on WebElement in Selenium using Java:

  • setProperty of geckodriver to Launch Firefox Browser.
  • Create a driver object to handle WebDriver Methods.
  • Using driver.get Open URL in Browser.
  • Create Instance / Object of Action Class to Perform Double Click Operation.
  • Find WebElement where we want to Perform Double Click Operation.
  • Perform doubleClick operation on WebElement using in-Built Method of Action Class.

 

Example to Perform Double click in Selenium: 

Double Click an element using Selenium WebDriver with Java and code to double click an element using selenium and check double click in selenium webdriver