Issue
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.
Solution
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]);
Answered By - Ihar Dziamidau
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.