I'm working with an input box with type="time"
. Text can be typed into the field or it can be selected in 15 minute increments by clicking on the little clock symbol bringing up the drop down. What I need is two minutes past the current time but I getting an element not interactable error
The default in the input box is set to 12:00 AM. The ID is for sure time as it will highlight and delete the default time.
Here's what I've tried. The error is on the last sendKeys
line
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("h:mm a");
timeEntered = dtf.format(LocalDateTime.now().plusMinutes(2)).toString();
WebElement time = driver.findElement(By.id("time"));
time.click();
actions.sendKeys(Keys.ARROW_RIGHT).perform();
actions.keyDown(Keys.SHIFT).sendKeys(Keys.HOME).perform();
actions.sendKeys(Keys.DELETE).perform();
driver.findElement(By.id("time").sendKeys(timeEntered);
I also tried:
driver.findElement(By.id("time")).clear();
org.openqa.selenium.ElementNotInteractableException: element not interactable