Following QuickTest Professional license features can be used with Unified Functional Testing as well:
FT-unified – QuickTest Professional core product + core addins (Visual Basic, Web, and ActiveX)
FTAddins – QuickTest Professional non-core addins
QuickTestPro – QuickTest Professional core product + core addins (Visual Basic, Web, and ActiveX)
QTAddins – QuickTest Professional non-core addins
If Unified Functional Testing is using any of the above QuickTest Professional license features, only the GUI part will be available.
In order to have the API part also available in Unified Functional Testing, following license feature should be used:
ServiceTest – Service Test (only API testing available in Unified Functional Testing with this feature)
UnifiedFunctionalTesting – Unified Functional Testing full product (API and GUI testing available). This license feature can aslo be used by QuickTest Professional 11 and Service Test 11.00 (and above) core products and QuickTest Professional add-ins.
How to create automation scripts for Unified Functional Testing (UFT).
o Decide whether to use UFT Automation Scripts
Creating a useful UFT automation script requires planning, design time, and testing. It must always weigh the initial investment with the time and human-resource savings it is gain from automating potentially long or tedious tasks.
Any UFT operation that must be performed many times in a row or must perform on a regular basis is a good candidate for a UFT automation script.
Choose a language and development environment for designing and running Automation scripts
For each language, there are a number of development environments available for designing and running automation scripts.
2. Create the Application object
The procedure for creating the Application object differs slightly from language to language. Below are some examples for creating the UFT Application object and starting UFT in visible mode, using different programming languages.
The example below can be used only after setting a reference to the type library. If not working in a development environment that allows referencing type libraries, create the Application object as described for VBScript below.
Dim qtApp As QuickTest.Application ‘ Declare the application object
Set qtApp = New QuickTest.Application ‘ Create the application object
qtApp.Launch ‘ Start QuickTest
qtApp.Visible = True ‘ Make it visible
Set qtApp = CreateObject("QuickTest.Application") ‘ Create the application object
qtApp.Launch ‘Start QuickTest
qtApp.Visible = True ‘ Make it visible
var qtApp = new ActiveXObject("QuickTest.Application"); // Create the application object
qtApp.Launch(); // Start QuickTest
qtApp.Visible = true // Make it visible
#import "QTObjectModel.dll" // Import the type library
QuickTest::_ApplicationPtr spApp; // Declare the application pointer
spApp.CreateInstance("QuickTest.Application"); // Create the application object
spApp->Launch();// Launch the application
spApp->Visible = VARIANT_TRUE; // Make it visible
Reference the type library – optional
Some development environments support referencing a type library. A type library is a binary file containing the description of the objects, interfaces, and other definitions of an object model.
If choosing a development environment that supports referencing a type library, it can be used the advantage of features like Microsoft IntelliSense, automatic statement completion, and status bar help tips while writing the script. The UFT automation object model supplies a type library file named QTObjectModel.dll. This file is stored in <Unified Functional Testing installation folder>bin.
If an environment that supports it is chosen, be sure to reference the UFT type library before begin writing or running the automation script. For example, if working in Microsoft Visual Basic, select Project > Add Reference to open the Add Reference dialog box for the project. Then select Unified Functional Testing<Version> Object Library (where <Version> is the current installed version of the UFT automation type library).
Write the automation script
The structure for script depends on the goals of the script. It might be performed a few operations before starting UFT such as retrieving the associated add-ins for a test or component, loading add-ins, and instructing UFT to open in visible mode.
After performing these preparatory steps, if UFT is not already open on the computer, UFT can be opened using the Application.Launchmethod. Most operations in automation script are performed after the Launch method.
Tip: Automation scripts can be generated from UFT that contain the settings for the Test Settings dialog box, the GUI Testing tab in the Options dialog box, and the Object Identification dialog box as they are set on the computer. Then each generated script can be run as is to instruct UFT to open on other computers with the exact dialog box configuration defined in the generated script, or copying and pasting selected lines from the generated files into own automation script.
When finish performing the necessary operations, or wanting to perform operations that require closing and restarting UFT (such as changing the set of loaded add-ins), use the Application.Quit method.
Run the automation script
There are several applications available for running automation scripts. It is possible also to run automation scripts from the command line using Microsoft’s Windows Script Host.
For example, the following command line can be used to run the automation script: