Desktop web testing code sample

The following example starts UFT One, opens a new test, and configures it for recording and running on a Web application.

It includes the following steps:

  1. SetLab - LocalBrowser
  2. Env - Retrun: MobileCenter|LocalBrowser
  3. Parameterization - BrowserParameterName|Parameterization(DataTable|TestParameter)

This example assumes that UFT One is not open.

Dim qtApp 'As QuickTest.Application ' Declare the application object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the application object
'1
qtApp.Test.Settings.Launchers("Web").SetLab "LocalBrowser"
'2
qtApp.Test.Settings.Launchers("Web").Env
'3
qtApp.Test.Settings.Launchers("Web").Browser = "IE"
msgbox qtApp.Test.Settings.Launchers("Web").Browser
'4
qtApp.Test.Settings.Launchers("Web").BrowserParameterName = "aaa"
msgbox qtApp.Test.Settings.Launchers("Web").BrowserParameterName
qtApp.Test.Settings.Launchers("Web").ParameterizationType = "DataTable"
msgbox qtApp.Test.Settings.Launchers("Web").ParameterizationType
qtApp.Test.Settings.Launchers("Web").ParameterizationType = "TestParameter"
msgbox qtApp.Test.Settings.Launchers("Web").ParameterizationType
qtApp.Visible = True ' Make the UFT One application visible
Set qtApp = Nothing ' Release the Application object

See also: