I am struggling with trying set some input on one of third party webpages that has an angular-related fields validation. When I only set the value attribute by chrome browser or with cefsharp, in both cases, the value is not being set.
I have found a walkaround - to enter one char in required fields to make it ng-touched and then set the js value attribute of it.
- In CefSharp, I am creating the KeyEvent and then I am sending it
- Then, I am setting the value of the field using CefSharp's EvaluateScriptAsync or ExecuteJavaScriptAsync When I am doing it manually with browser, it works but under cefsharp it is not working - it sets the one char in both fields, but then, after changing the value of fields and verifying it in 3 ways does not work:
1)reading the value by EvaluateScriptAsync/ExecuteJavaScriptAsync The value is being set correctly, but at the end, there is only a first change applied 2)rendering a html by GetSourceAsync() - it renders temporarily the result page with first pre-change only 3)also the same with screenshot functionality of cefsharp
Of course I am unable to use Angular Development tools plugin, because app is in production mode.
What I have also tried: -using Thread.Sleep with many timespans - did not help -input.dispatchEvent(new Event('input',{bubbles:true})) - same effect as previous
- multiple changes of value pre-set - same effect
- multiple setting of a final value - the same
The only working solution I have created was to focus on every required field, then iterate over every string as single char and send it as single key, but it was unefficient and had been refused :(