Here’s one of the never-ending Selenium problems when the page/app is running Angular:
Markup:
<input placeholder="dd.mm.åååå" class="mat-datepicker-input hb-datepicker ng-pristine ng-valid ng-touched"
id="0-person-fodselsdato" aria-haspopup="dialog" min="1900-01-01" max="2024-04-25" data-mat-calendar="mat-datepicker-1">
This used to be a simple input field, and things worked well. Then someone decided that adding a date picker was a good idea, and now Selenium is unable to interact with the input field.
When breaking the test, I can manually select and enter text into the field.
Selenium (Java):
driver.findElement(By.id("person-" + index + "-fodselsdato")).click();
driver.findElement(By.id("person-" + index + "-fodselsdato")).sendKeys(dato);
The first line, with the click(), is there just for test purposes.
The click() line reports no error.
The sendkeys() line reports
org.openqa.selenium.ElementNotInteractableException: element not interactable
I could, of course, wite a method that uses the date picker. But since this is not a GUI test, and I just need to populate the field, that’s a massive unnecessary use of time and code complexity.
Any ideas?