I am trying to automate a web entry form with C# using WebView2.
Web entry form has three DOM Elements: Input (UserName/Password) and Entry Button (disabled).
If you enter value to input areas by keyboard (manually) Entry Button is enabled. But sending Java Scripts to set value of input boxes do not make this button enabled. Of course it is a guard to disable automation of this page…
Is there a way to make Entry Button enabled with java script?
Page image is below:
2
Answers
It seems that site owner has arranged actions for ‘Entry Button’ will be enabled only by keystroke. Guard against automation…
To simulate keystroke action you may use below code for each DOM element:
This will activate ‘Entry Button’ by pasting your data like keystrokes…
For those interested I’ve just released WebView2.DevTools.Dom to NuGet.org. It’s free for anyone to use.
More details and examples in the Readme
This will simulate both key presses and mouse move/clicks.