Selenium Java - Handling Form Elements
What is wrong with this Selenium Java code snippet for selecting a date?
WebElement submitBtn = driver.findElement(By.id("submitBtn"));
driver.findElement(By.xpath("//td[@data-date='2024-06-15']")).click();
submitBtn.click();
The test fails with StaleElementReferenceException on the second click.