I am using the CefSharp Chromium Webbrowser and I wanted to login on a website.
That´s my code so far:
Private WithEvents browser As ChromiumWebBrowser
Public Sub New()
InitializeComponent()
Dim settings As New CefSettings()
CefSharp.Cef.Initialize(settings)
browser = New ChromiumWebBrowser("mysite.com/login") With {
.Dock = DockStyle.Fill
}
panBrowser.Controls.Add(browser)
End Sub
That´s working. Now I wanted to fill the username and password textbox. I archieved it like this:
browser.ExecuteScriptAsync("document.getElementById('login-username').value = 'user@gmail.com'")
browser.ExecuteScriptAsync("document.getElementById('login-password').value = 'password'")
That´s working too, I can see my credentials entered. But when I press login, it tells me, that the textfields are empty. When I type in a letter by myself, it´s working. Why? Is there another way to enter the credentials with JS or CefSharp?
Thank you very much :)