Working with Certify Hooks
Certify hooks provide the mechanism to call or start external programs in Certify processes. When you add a hook to a project, the external program opens during process execution, and process results are sent.
Data Files
Certify generates and saves the following hook data files in a Worksoft sub-folder under the folder specified by the TEMP system environment variable:
- The main data file contains the execution log result data of the selected item. This file has a unique generated name, and it has an XML file extension.
- Image data files in standard JPG image file format are generated from image capture data retrieved from execution log steps. These image data files have unique generated names with a JPG file extension.
- File names are generated from TempFileCollection class. The default constructor sets the properties of the instance to the default values. The KeepFiles property is set to True to keep the files from being deleted when the class is closed. The AddExtension method with the extension value of XML or JPG is called to get the temporary file name.
Data File Format
The data file format is specified by the code used in the current results export function. The generation of the data file for the hooks is provided by the current code used by the export function.
Updating Files
The Certify Auto-Updater program updates any files placed in the Hooks Update folder by overwriting the local file when a newer file is found in the Hooks Update folder. If the program is unable to update a hook file, then an error message displays.
Certify Hook Procedure Example
In this example, Certify writes a result to a temporary XML file and passes the file name to Notepad.
-
Create a hook.
For more information, see Creating Hooks.
-
In the Path field, enter the path for Notepad:
C:\Windows\System32\notepad.exe
-
After you have created your hook, you need to associate the hook to a project.
For more information, see Adding a Hook to a Project.
-
Execute the hook in the Results window.
For more information, see Executing Hooks.
A temporary result.xml file is generated, and the result.xml file opens in Notepad.
-
If needed, you can extract data from the file and make calls to existing Worksoft APIs.