This test opens a page, double clicks a box, and checks if the success message appears.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class DoubleClickTest {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "path/to/chromedriver");
WebDriver driver = new ChromeDriver();
try {
driver.get("https://example.com/doubleclickpage");
WebElement box = driver.findElement(By.id("doubleClickBox"));
Actions actions = new Actions(driver);
actions.doubleClick(box).perform();
String message = driver.findElement(By.id("message")).getText();
if ("Double click successful".equals(message)) {
System.out.println("Test Passed");
} else {
System.out.println("Test Failed");
}
} finally {
driver.quit();
}
}
}