Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

This is a dynamic list we have in our site.

List Page

This is the HTML tag where I want to pass double click on.

<td class="dxgv" align="left" style="color: rgb(51, 51, 51); font-size: 13px; border-bottom: 1px solid rgb(237, 237, 237); border-left-width: 0px; border-right-width: 0px; width: 5.6em; max-width: 6em; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">Sun Kumar</td>

I want to double click on the first record all the time even though first record gets deleted after each click

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
684 views
Welcome To Ask or Share your Answers For Others

1 Answer

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();

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...