The web application I am testing requires confirmation when deleting a record.
I have created a test to enter in a valid reason for deleting this record.
Th
As per the HTML you have shared the <input>
element with placeholder
attribute as Removal reason is an Angular element and as you have to send text, you have to induce WebDriverWait for the element to be clickable as follows :
IWebElement myElem = new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("//input[@class='ng-valid md-input ng-not-empty md-autofocus ng-touched ng-dirty ng-valid-parse' and starts-with(@id,'input_') and @placeholder='Removal reason']")));
myElem.Click();
myElem.Clear();
myElem.SendKeys("Automated Test - Delete Field");
You can find a couple of relevant discussions in:
I was having the same issue, only I was trying to enter a dash in a date field that didn't allow dashes. I figured this out by manually entering a date with a dash and it did not populate. (The field also doesn't accept letters - just numbers). Now, my test enters a date without a dash and it passes successfully!