Number Example

The following example demonstrates how to create and pass number parameters in a single script that tests the Notepad application.

The script contains:
Public Module Main
 Dim _desktop As Desktop = Agent.Desktop

  Public Sub Main(args As IDictionary(Of String, Object))
    Dim N1 As Integer = CType(args("Num1"), Integer)
    Dim N2 As Integer = CType(args("Num2"), Integer)
	
      With _desktop.Window("@caption='Untitled - Notepad'")
        .TextField().ClearText() 			
        .TextField().TypeKeys("<Enter>"+ "Numbers" + "<Enter>")
        .TextField().TypeKeys(N1)
        .TextField().TypeKeys("<Enter>")
        .TextField().TypeKeys(N2)
        .TextField().TypeKeys("<Enter>")		
      End With
  End Sub

  Public Sub Main()
    Dim args As New Dictionary(Of String, Object)
		
      args.Add("Num1", 35)
      args.Add("Num2", 25)
		
      Main(args)
  End Sub
End Module