Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How do I set up a TestCaseExit/TestCaseEnter function to over-ride the default function used by SilkTest?

How do I set up a TestCaseExit/TestCaseEnter function to over-ride the default function used by SilkTest?

This is an example of how to create and implement your own TestCaseEnter and/or TestCaseExit function, in order to over-ride the Default enter and exit functions used by SilkTest. Files with the working example are available to download at the bottom of this resolution.

  1. Write your TestCaseExit function into your include file. (Note: All TestCaseExit functions must include the first 3 lines as shown below)

    A TestCaseEnter function would look like this:

  2. Create a script file and testcases, which you wish to use the TestCaseExit/TestCaseEnter function(s). Every testcase in this script file will use the function(s), so make sure that it is ok to do this for each of the testcases in your script.

  3. Make sure that your script is referencing the include file where your function(s) resides, if not, then it will have no access to your function and will instead use the default. You will not be able to over-ride the default unless you reference the file where your function(s) is located. This can be done either in the Options/Runtime "Use Files" section or by adding a "Use" statement into your script (as seen below).

  4. Now you are ready to run the script. As long as the script is referencing the include file, SilkTest will execute the TestCaseEnter function before running the testcase, and when your testcase has finished executing, SilkTest will automatically call your TestCaseExit function and execute. In the example below, the testcase has referenced both user-defined functions. As you can see, the file shows that the TestCaseEnter was executed first, followed by the script and the TestCaseExit was the last to be executed.


Working Example of process explained above:

Related documents:

Old KB# 21871

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:25
Updated by:
 
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.