Howto: do basic things using ProjectWhite/White

Howto:
– launch an application
– navigate into a submenu
– get a hold of a MDIChild-window.


Public Class Test1

Private Const path As String = "C:\Path\myprogram.exe"

Public Sub TestMethod1()
Dim application As Application = application.Launch(path)

//Find the form
Dim main_window = application.GetWindow("name of window", InitializeOption.NoCache)
Assert.IsNotNull(main_window)

//Find the Menubar and its choices
Dim menu As MenuItems.Menu = window.MenuBar.MenuItem("Menu choice")
menu.Click()
Dim openSubMenuChoice = menu.SubMenu("Submenu choice")
openSubMenuChoice.Click()

//Find the MDIChild-window
Dim child_window = main_window.MdiChild(SearchCriteria.ByControlType(ControlType.Window))
Assert.IsNotNull(child_window)

application.Kill()
End Sub
End Class