ResExtract Function

Action

Extracts information from a results (.res) file to a text (.txt) file.

Syntax

ResExtract ( [ sTxtFile, IncludeOutputText, IncludeErrorText, IncludeSummaryText, Expand])
Variable Description
sTxtFile Optional: If a text file name is passed, the file is saved as exactly that name, without a .txt extension, in the current working directory. If a relative or absolute path is provided with the file name, the file is saved to the specified directory.
IncludeOutputText Optional: Specifies whether to extract the output of print statements. The default value is TRUE. BOOLEAN.
IncludeErrorText Optional: Specifies whether to extract text generated by the functions LogError and ExceptLog. The default value is TRUE. BOOLEAN.
IncludeSummaryText Optional: Specifies whether to extract which tests passed and failed and the number of errors produced by failed tests. The default value is FALSE. BOOLEAN.
Expand Optional: Specifies which units to extract information about. The possible values are:
RX_SCRIPTS
Only scripts.
RX_TESTCASE
Scripts and test cases.
RX_ERRORS
Anything with errors.
The default value is RX_TESTCASE. ENUM.

Notes

When no argument is passed, the text file name is the same as the name of the .t file from which the function is called, with a .txt extension. The file is saved in the current working directory.

Examples

The following statement extracts the most recent results set and saves the information in the specified location as db.txt.
ResExtract ("d:\mytests\db.txt")
The following statement extracts the most recent results set and saves the information in the current working directory as textres1.
ResExtract ("textres1")
The following statement extracts the most recent results set and saves the information in the current working directory as textres2, extracting the output of string statements and which tests passed and failed. Anything with errors is extracted.
ResExtract ("textres2", TRUE, FALSE, TRUE, RX_ERRORS)