Gokul Gokul - 4 months ago 47
Java Question

Selenium webdriver Java code using web driver for double click a record in a grid

How to write selenium java code for doubleClick on a record using webdriver

I have displayed some records in the body part. Once I click on a record we should get a popup window to update it.

Please suggest how to write Selenium Java code using web driver.

I have tried this:

Actions action = new Actions(driver);
action.moveToElement(driver.findElement(By.xpath("//table/tbody/tr[2]/td/div/div/table/tbody/tr[10]/td[1]"))).doubleClick().build().perform();

Answer
Actions action = new Actions(driver);
action.moveToElement(driver.findElement(By.xpath("//table/tbody/tr[2]/td/div/div/table/tbody/tr[10]/td[1]"))).doubleClick().perform();

This code works!!!