Control How Items Within Java Objects Are Recorded

Source code

Copy code
'************************************************************************************************************************
'Description:
'
'This example opens the testing application and configures its Java options.
'
'************************************************************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtJavaOptions 'As QuickTest.JavaOptions ' Declare the Java Options object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.SetActiveAddins Array("Java") ' Load the Java Add-in
qtApp.Launch ' Start the testing application
qtApp.Visible = True ' Make the application visible
qtApp.Open "C:\Tests\Test1", False

Set qtJavaOptions = qtApp.Options.Java ' Return the Java Options object

' Configure the Java options
qtJavaOptions.RecordListByIndex = False 'Record list items by name
qtJavaOptions.RecordComboByIndex = True 'Record combo box selections by index
qtJavaOptions.RecordTreeByIndex = False 'Record tree node selection by name
qtJavaOptions.RecordTabByIndex = False 'Record tab selections in tabbed pane controls by name
qtJavaOptions.AttachedTextRadius = "100" 'Look for the components' attached text within a 100 pixels radius
qtJavaOptions.AWTEventModel = "Auto" ' Enable the applicationto automatically select the model for sending events to objects
qtJavaOptions.AnalogTableRecording = True 'Record table operations in analog mode

Set qtJavaOptions = Nothing ' Release the Java Options object
Set qtApp = Nothing ' Release the Application object