Set Up Your Stingray project using the Precompiled Agent mode

Note: Use the precompiled agent mode only if the run-time agent mode is unsuitable or cannot be used.

Prerequisites

  • Both Stingray Objective Grid and Stingray Objective Toolkit must be installed on your computer, even if your 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. For a list of supported version combinations, see the Unified Functional Testing Product Availability Matrix.

    Note: If you do not have the required Stingray Objective Grid and Stingray Objective Toolkit version combination, contact Software Support for assistance.

  • If your Stingray application was previously compiled with agent files from an earlier version of the Stingray Add-in, remove the existing agent files from your project.

    Caution: If you choose not to replace your existing Stingray Add-in agent files with the latest agent files, do not continue with this procedure. Although you will be able to work with the UFT Stingray Add-in, you will not be able to take advantage of the latest functionality.

Back to top

Copy StgAgentLib.h and StgAgentLib.lib files

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

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

    For example, if your 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 InstallationFolder>\bin\StingrayAgent\AgentLib\bin\MFC80\OG1000U_OT900U

    Note: Each support library file specifies a combination of Objective Grid and Objective Toolkit versions. You must choose a combination of Objective Grid or Objective Toolkit versions, even if your application uses only one of these Stingray tools. For a list of supported Stingray version combinations, see the Unified Functional Testing Product Availability Matrix.

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

Back to top

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

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

Back to top

Add the ReleaseWRVC(); function call

Insert the ReleaseWRVC(); function call in one of the functions called when your 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.

Back to top

Ensure the Precompiled Agent option is selected

For details, see Stingray Support Configuration Wizard.

Back to top

Results

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

Back to top