Absent Member.. Absent Member..
Absent Member..

UFT support tip: How to Set Up the Stingray Project Using the Precompiled Agent Mode

The following information represents the prerequisites and the steps for setting the Stingray project for testing with Unified Functional Testing (UFT).


1. Prerequisites

  •  Both Stingray Objective Grid and Stingray Objective Toolkit must be installed on the computer, even if the application contains only one type of Stingray control, such as a grid control or a tab control.
  • The installed versions must match the version combinations supported for this add-in.
    Note: If not having the required Stingray Objective Grid and Stingray Objective Toolkit version combination, contact HP Software Support for assistance.
  • If the Stingray application was previously compiled with agent files from an earlier version of the Stingray Add-in, remove the existing agent files from the project.
    Caution: If choosing not to replace the existing Stingray Add-in agent files with the latest agent files, do not continue with this procedure. Although it will be able to work with the Unified Functional Testing Stingray Add-in, it will not be able to take advantage of the latest functionality.

2. Copy StgAgentLib.h and StgAgentLib.lib files

       a. Copy the StgAgentLib.h header file from <UFT Installation Folder>\bin\StingrayAgent\AgentLib\src\StgAgentLib.h to the Visual C++ project directory. (It can optionally be added the header file to the list of header files in the workspace.)

       b. Check the version of the Stingray Objective Grid or Stingray Objective Toolkit used by the application and search for the corresponding support library file, StgAgentLib.lib.

For example, if the application is not compiled in Unicode and uses Objective Grid version 9.03 and Objective Toolkit version 8.03 linked with MFC version 7.1, search for the library file in: <UFT Installation Folder>\bin\StingrayAgent\AgentLib\bin\MFC71\OG903_OT803

If the application is linked with MFC80, is compiled in Unicode and uses Objective Grid version 10.0 and Objective Toolkit version 9.0, search for the library file in: <UFT Installation Folder>\bin\StingrayAgent\AgentLib\bin\MFC80\OG1000U_OT900U

Note: Each support library file specifies a combination of Objective Grid and Objective Toolkit versions. It must be choosen a combination of Objective Grid or Objective Toolkit versions, even if the application uses only one of these Stingray tools.

       c. Copy the StgAgentLib.lib support library file to the Visual C++ project directory.


3. Add #include "StgAgentLib.h" to a .cpp file

Add the #include "StgAgentLib.h" statement to one of the cpp files, such as, MainFrm.cpp.


4. Add the ReleaseWRVC(); function call

Insert the ReleaseWRVC(); function call in one of the functions called when the application terminates, for example, CMainFrame::OnDestroy().

Note: Inserting this function call instructs the agent to perform required clean up operations related to the support library code.


5. Make sure that the Precompiled Agent option is selected in the Stingray Support Configuration Wizard


6. Results

When building the application executable, the added header file automatically links the StgAgentLib.lib support library to the application statically, enabling the library code to be activated automatically during the run session.


HP support
If you find this useful, mark Kudos.
Note: The Opinions expressed in my post are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any answered posted.

Labels (1)
0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.