How to double click on an element using Selenium Webdriver

前端 未结 1 847
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-19 14:58

This is a dynamic list we have in our site.

\"List

This is the HTML tag where I want to pass do

相关标签:
1条回答
  • 2020-12-19 15:13

    Since, you want to double click on the first record, you can try this java code:

    (Assuming there is one table in the webpage, as complete HTML code is not available above and the row for the contents starts with 2nd.)

    Actions act = new Actions(driver);
    act.doubleClick(driver.findElement(By.xpath("//table//tr[2]//td[@class='dxgv'][1]"))).build().perform();
    

    OR

     Actions act = new Actions(driver);
     act.moveToElement(driver.findElement(By.xpath("//table//tr[2]//td[@class='dxgv'][1]"))).doubleClick().build().perform();
    
    0 讨论(0)
提交回复
热议问题