Typically, when you record a script, a base state is automatically recorded that starts the application that you want to test. However, if your script tests multiple applications or you turn off the Execute base state functionality for any reason, you must start the test application from within your script.
Dim applicationProcess As New Process()where applicationProcess is the name of the application that you want to start. For example, to start Internet Explorer, type:
Dim ieProcess As New Process()
Dim psi As New ProcessStartInfo() psi.FileName = "applicationexecutable.exe"where applicationexecutable.exe is the name of the executable file that launches your test application. For example to start Internet Explorer, type:
Dim psi As New ProcessStartInfo() psi.FileName = "C:\Program Files\Internet Explorer\iexplore.exe"
psi.Arguments = "http://www.google.com"
ieProcess.StartInfo = psi ieProcess.Start()
Imports System Imports System.Diagnostics Public Module Main Public Sub Main() Dim _desktop As Desktop = Agent.Desktop Dim ieProcess As New Process() Dim psi As New ProcessStartInfo() psi.FileName = "C:\Program Files\Internet Explorer\iexplore.exe" psi.Arguments = "http://www.google.com" ieProcess.StartInfo = psi ieProcess.Start() End Sub End Module