Issue - Getting 'Element is no longer attached to the DOM'
Approach - 1. Check if the element is displayed on the webpage 2. Trying to click the element
Code -
System.out.println("boolean value of Confirm order is" +driver.findElement(By.id("confirmOrder")).isDisplayed());
if (driver.findElement(By.id("confirmOrder")).isDisplayed() == true) { driver.findElement(By.id("confirmOrder")).click();
//driver.findElement(By.id("confirmOrder")).sendKeys("{Enter}");
//actions.moveToElement(driver.findElement(By.id("confirmOrder"))).build().perform();
//actions.click().perform();
System.out.println("button clicked");
}
Output boolean value of Confirm order istrue button clicked
Tried couple of approaches but none seems to be working. Any help is appreciated.