Configure Web Options
Source code
'************************************************************************************************************************
'Description:
'
'This example opens UFT and configures its Web options.
'
'Assumptions:
'There is no unsaved test currently open in UFT.
'For more information, see the example for the Test.SaveAs method.
'************************************************************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtWebOptions 'As QuickTest.WebOptions ' Declare the Web Options object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.SetActiveAddins Array("Web") ' Activate the Web Add-in
qtApp.Launch ' Start UFT
qtApp.Visible = True ' Make the UFT application visible
Set qtWebOptions = qtApp.Options.Web ' Return the Web Options object

' Configure the Web options
qtWebOptions.AddToPageLoadTime = 30 ' Set the time added to page load time to 30 seconds

' Configure advanced Web options
qtWebOptions.EnableBrowserResize = False ' Set to open the browser to its default size
qtWebOptions.RunUsingSourceIndex = True ' Set to use the source index property (for better performance)
qtWebOptions.UseAutoXPathIdentifiers = True ' Instruct UFT to learn and use an XPath property during a run session
qtWebOptions.RunOnlyClick = True ' Set to run click events as MouseDown, MouseUp and Click
qtWebOptions.BrowserCleanup = True ' Set to close all open browsers when test/iteration finishes
qtWebOptions.RecordByWinMouseEvents = "OnClick OnMouseDown" ' Indicate for which events to use standard Windows events
qtWebOptions.RecordAllNavigations = True ' Set to record navigation each time the URL changes
qtWebOptions.RecordMouseDownAndUpAsClick = False ' Set to record MouseDown and MouseUp instead of Clicks
qtWebOptions.RecordCoordinates = False ' Instruct UFT not to record actual coordinates
If qtWebOptions.PageCreationMode = "URL" Then ' If optimizing Page object creation is currently selected (URL mode) then
    qtWebOptions.CreatePageUsingNonUserData = "Get" ' Instruct UFT to ignore non-user data if using Get transfer method
    qtWebOptions.CreatePageUsingUserData = "Get Post" ' Instruct UFT to ignore user data if using Get/Post transfer method
    qtWebOptions.CreatePageUsingAdditionalInfo = False ' Instruct UFT to not to use additional properties to identify existing Page
End If
If qtWebOptions.FrameCreationMode = "URL" Then ' If optimizing Frame object creation is currently selected (URL mode) then
    qtWebOptions.CreateFrameUsingNonUserData = "Get" ' Instruct UFT to ignore non-user data if using Get transfer method
    qtWebOptions.CreateFrameUsingUserData = "Get Post" ' Instruct UFT to ignore user data if using Get/Post transfer method
    qtWebOptions.CreateFrameUsingAdditionalInfo = False ' Instruct UFT to not to use additional properties to identify existing Frame
End If

Set qtWebOptions = Nothing ' Release the Web Options object
Set qtApp = Nothing ' Release the Application object