通常、スクリプトを記録すると、テストするアプリケーションを起動する基本状態が自動的に記録されます。 ただし、スクリプトで複数のアプリケーションをテストするか、何らかの理由で 基本状態の実行 機能をオフにする場合は、スクリプト内からテスト アプリケーションを起動する必要があります。
Dim applicationProcess As New Process()applicationProcess は、起動するアプリケーションの名前です。 たとえば、Internet Explorer を起動するには、以下のように入力します。
Dim ieProcess As New Process()
Dim psi As New ProcessStartInfo() psi.FileName = "applicationexecutable.exe"applicationexecutable.exe は、テスト アプリケーションを起動する実行可能ファイルの名前です。 たとえば、Internet Explorer を起動するには、以下のように入力します。
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