Set the Record Mode for Java Tables

Source code

Copy code
'This example opens UFT One 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 UFT One
qtApp.Visible = True ' Make the UFT One 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 UFT One to 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