JavaLauncher Object
JavaLauncher Object
Description
Represents the Java tab of the Record and Run Settings dialog box, which determines which Java application or applet to open (if any) when a record or run session begins.
Example
'************************************************************************************************************************
'Description:
'
'This example starts UFT, opens a new test, and configures
'it for recording and running on a Java application.
'
'Assumptions:
'UFT is not open.
'************************************************************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the application object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the application object

qtApp.SetActiveAddins Array("Java") ' Activate the Java Add-in
qtApp.Launch ' Start UFT
qtApp.New ' Open a new test

' Configure the Java application to use with this test
qtApp.Test.Settings.Launchers("Java").Active = True
qtApp.Test.Settings.Launchers("Java").CommandLine = "C:\j2sdk1.4.2\bin\java.exe -jar C:\j2sdk1.4.2\demo\jfc\SwingSet2\SwingSet2.jar"
qtApp.Test.Settings.Launchers("Java").WorkingDirectory = "C:\j2sdk1.4.2\demo\jfc\SwingSet2"

qtApp.Visible = True ' Make the UFT application visible
Set qtApp = Nothing ' Release the Application object
Public Properties
Public Property Active Indicates whether to record and run on any open Java application or applet (False) or to open a specified application or applet (True) when a record or run session begins.
Public Property CommandLine The command line options to use to open the application.
Public Property WorkingDirectory The working directory from which to run the specified executable file or command line.
See Also