title: Interaction Win Form and Web Browser, advice? Winium? Watin? White? Sikuli?
body: <p>I want to create a .NET app which helps me to manage and automate a web browser.
  I did a quick search, and I found some solutions.</p>
  
  <p>It seems that Selenium is the main reference software (open source), but it does not allow interaction between the Windows Form and the browser.</p>
  
  <p>If I understand correctly, based on the source code of Selenium, have been built others software that allow to do so.
  In particular I've read about Winium, Watin, White and Sikuli.</p>
  
  <p>At this page I've found a short comparison of some of them</p>
  
  <p><a href="https://blog.testproject.io/2016/12/22/open-source-test-automation-tools-for-desktop-applications/" rel="nofollow noreferrer">https://blog.testproject.io/2016/12/22/open-source-test-automation-tools-for-desktop-applications/</a></p>
  
  <p>I would like some advice on which one to use.</p>
  
  <p>I'm an amateur programmer in VB.NET, but I've no problem in translating from C#.</p>
  
  <p>I would like to use Chrome, but regarding Watin I read that it does not support Chrome, and it supports old version of other browser (Internet Explorer 9, and Firefox 2.x).
  Do you know if this actually create problems in loading pages?</p>
  
  <p>I also need a software that can handle the delay while loading pages.</p>
  
  <p>In example, with .NET WebBrowser class, I use the instruction:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Do Until wb.ReadyState = WebBrowserReadyState.Complete
  </code></pre>
  
  <p>Or previously I mix WebBrowser class with HtmlAgilityPack, in this mode:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Do
    Application.DoEvents()
    ' we create a delay, that allow the page to be loaded correctly:
    ' Thread.Sleep(...) Don't allow the page load correctly
    Dim delay as Date = Date.Now.AddMilliseconds(1000)
    Do While delay &gt; Date.Now
    Loop
    documentAsIHtmlDocument3 = DirectCast(wb.Document.DomDocument, mshtml.IHTMLDocument3)
    sr = New StringReader(documentAsIHtmlDocument3.documentElement.outerHTML)
    docPreview.Load(sr)
    nodeTmp1 = docPreview.DocumentNode.SelectSingleNode("//div[@id='content']")
    nodeModule = nodeTmp1.SelectNodes("descendant:: div[@class='module']")
  Loop Until IsNothing(nodeModule) = False
  </code></pre>
  
  <p>But I don't like this type of solution for lots of reasons, and reading the code, I think you could imagine why.</p>
  
  <p>Do you have advices?</p>
  
  <p>10/01/2018 Update: i've found a similar thread:</p>
  
  <p><a href="https://stackoverflow.com/questions/1307800/view-generated-source-after-ajax-javascript-in-c-sharp">View Generated Source (After AJAX/JavaScript) in C#</a></p>
  
  <p>Where users confirm they feel good using of Selenium and Watin.
  They rise an issue about slow performance.
  Others suggestions?</p>
  
  <p>_________ in reply to Rescis _________</p>
  
  <p>This is a piece of code i made with Watin</p>
  
  <pre class="lang-vb prettyprint-override"><code>Imports WatiN.Core
  ...
  Private browser As New IE
  ...
  browser.GoTo("https://www.the_site_with-wich_i_have_my_account/")
  ...
  Private Sub joinAccount()
      'Usually a website it's built with an HTML 'container' that contains Username and Password textBox and a Join button:
      'With chrome right click on that element, and 'inspect element' we can analize the HTML code and we can find the name of the class of the container
      Dim formLogin As WatiN.Core.Form = browser.Form(Find.ByClass("class_found_from_chrome_inspect_element"))
      'search for Username textBox
      Dim tbUsername As WatiN.Core.TextField = formLogin.TextField(Find.ById("Username_textField_found_from_chrome_inspect_element"))
      'set our username
      tbUsername.SetAttributeValue("value", "my_username")
      'search for Password textBox
      Dim tbPassword As WatiN.Core.TextField = formLogin.TextField(Find.ById("Password_textField_found_from_chrome_inspect_element"))
      'set the password
      tbPassword.SetAttributeValue("value", "my_password")
      'search the Join button and perform click
      formLogin.Button(Find.ById("Join_button_found_from_chrome_inspect_element")).Click()
  End Sub
  </code></pre>