SRF web testing code sample

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

It includes the following steps:

  1. SetLab - LocalBrowser|SRFDesktopBrowser
  2. Env - Retrun: SRF|MobileCenter|LocalBrowser
  3. SRF - Tunnel|OS|Browser|Resolution
  4. Parameterization - BrowserParameterName|Parameterization(DataTable|TestParameter)

This example assumes that UFT 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"
qtApp.Test.Settings.Launchers("Web").SetLab "SRFDesktopBrowser"
'2
qtApp.Test.Settings.Launchers("Web").Env
'3
qtApp.Test.Settings.Launchers("Web").SRF.Browser = "Internet Explorer 11"
msgbox qtApp.Test.Settings.Launchers("Web").SRF.Browser
qtApp.Test.Settings.Launchers("Web").SRF.OS = "Windows 100"
msgbox qtApp.Test.Settings.Launchers("Web").SRF.OS
qtApp.Test.Settings.Launchers("Web").SRF.Resolution = "1800x600"
msgbox qtApp.Test.Settings.Launchers("Web").SRF.Resolution
'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 application visible
Set qtApp = Nothing ' Release the Application object

See also: