DotNetBrowser DOM API provides functionality that allows you to simulate click on any HTML element on the loaded web page. To simulate click you need to make sure that web page is loaded completely and find the required HTML element in the document:

C#

DOMDocument document = browser.GetDocument();
DOMElement link = document.GetElementById("submit_button");

VB.NET

Dim document As DOMDocument = browser.GetDocument()
Dim link As DOMElement = document.GetElementById("submit_button")


Once you get the reference to the required HTML element, you can simulate click using the DOMNode.Click()method.

C#

link.Click();

VB.NET

link.Click()

Please note that this method works asynchronously. When this method returns, it doesn't mean that click simulation is finished.

This functionality can be useful in automated testing when you need to simulate user actions including mouse clicks on specified HTML elements. For example:

C#

browserView.Browser.FinishLoadingFrameEvent += delegate(object sender, FinishLoadingEventArgs e)
{
  if (e.IsMainFrame)
  {
    Browser myBrowser = e.Browser;
    DOMDocument document = myBrowser.GetDocument();
    DOMElement link = document.GetElementById("button");
    if (link != null)
    {
      link.Click();
    }
  }
};
browserView.Browser.LoadHTML("<html><body><button id='button' " +
    "onclick=\"alert('Button has been clicked!');\">Click Me!</button>" +
    "</body></html>");

VB.NET

AddHandler browser.FinishLoadingFrameEvent, sub(o, e)

    If e.IsMainFrame Then
        Dim myBrowser As Browser = e.Browser
        Dim document As DOMDocument = myBrowser.GetDocument()
        Dim link As DOMElement = document.GetElementById("button")
        If link IsNot Nothing Then

            link.Click()
        End If
    End If
End sub
browserView.Browser.LoadHTML("<html><body><button id='button' " +
                             "onclick=""alert('Button has been clicked!');"">Click Me!</button>" +
                             "</body></html>")