I am using CefSharp component in a Windows Forms C# application.
I load my page in the chromium browser and once loaded, I click a button in it using ExecuteScriptAsync
and close the form.
The code executes normally, but since this happens very quickly, how can I be sure that the button in the page is really clicked?
here is my code:
private void OnLoadingStateChanged(object sender, LoadingStateChangedEventArgs args)
{
if (!args.IsLoading)
{
chromeBrowser.ExecuteScriptAsync("document.getElementById('myButton').click();");
form1.Close();
}
}
Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…