Create a New Test
Source code
'************************************************************************************************************************
'Description:
'
'This example starts UFT, opens a new test, and configures it for recording and running on a Web 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

ret = qtApp.SetActiveAddins(Array("Web","ActiveX"), errDesc) 'Load the Web and ActiveX Add-ins

qtApp.Launch ' Start UFT
qtApp.New ' Open a new test

' Configure the Web application to use with this test
qtApp.Test.Settings.Launchers("Web").Active = True
qtApp.Test.Settings.Launchers("Web").Browser = "IE"
qtApp.Test.Settings.Launchers("Web").Address = "http://newtours.demoaut.com "
qtApp.Test.Settings.Launchers("Web").CloseOnExit = True

' Configure Active Screen access settings
qtApp.Test.Settings.Web.ActiveScreenAccess.UserName = "user1"
qtApp.Test.Settings.Web.ActiveScreenAccess.Password = "mypassword"

' Configure other Web settings
qtApp.Test.Settings.Web.BrowserNavigationTimeout = 60000
qtApp.Visible = True ' Make the UFT application visible
Set qtApp = Nothing ' Release the Application object