Using C# I cannot sendKeys to an angular tag I get this error Element

I have tried a bunch of solutions like implicit wait – this does not work, the text field is clickable by mouse but unreachable by keyboard, so values cannot be inputted but text field this can be clicked.

I also have this solution

             IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
             IWebElement element = driver.FindElement(By.Name("InvoiceAmount"));
             js.ExecuteScript("arguments[0].value='100';", element);

this does nothing and does not give any error also. Please help. Thank you.enter image description here

Answer

It is bcz of that you found wrong element. You found <app-currency-input>. But you have to get a nested input (native <input> element).

Try this:

    IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
    IWebElement element = driver.FindElement(By.Name("InvoiceAmount"));
    ReadOnlyCollection<IWebElement> inputElements = element.FindElements(By.TagName("input"));
    js.ExecuteScript("arguments[0].value='100';", inputElements[0]);