Double click
WebElement ele = driver.findelement(By.id("id_of_element")); Actions action = new Actions(driver) action.doubleClick(ele).perform();
Right click
WebElement ele = driver.findelement(By.id("id_of_element")); Actions action = new Actions(driver) action.contextClick(ele).build().perform();
If you need the second version of the popup that opens after right-clicking, you can use the code below
action.contextClick(ele).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).build().perform();
source share