Configure Recording on a Java Application
Source code
'************************************************************************************************************************
'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