How to automate a 'triple-click' using Java & Selenium?

こ雲淡風輕ζ 提交于 2019-12-05 18:45:39

It's been a while, but I believe this was the solution that ended up working for me:

import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;

public void tripleClick() {
    Actions action = new Actions(driver);
    WebElement cursor = driver.findElement(By.xpath("//div[contains(@id,'rCursor')]"));
    int count = 3;

    while(count>0){
        action.click(cursor).perform();
        count -= 1;
    }
}

Hope that helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!