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

Print verification pass or fail results to Silk Test Classic res file

Print verification pass or fail results to Silk Test Classic res file

This archive contains the following files:
    Verify2Res.inc

This archive provides a solution that prints both passed and failed verifications to the Silk Test Classic result file.

Software Requirements:
    SilkTest

Setup Instruction:
    
    1.    Extract the Verify2Res folder in the archive to the SilkTest installation directory

Description:

    The following function is available in Verify2Res.inc
    
        Verify2Res (WINDOW wWin, STRING sProp, BOOLEAN bExpected, STRING sDesc optional, BOOLEAN log2Res optional)


Usage:

    Once the Verify2Res folder has been extracted to the SilkTest installation directory,
    user can specify the Verify2Res.inc file in the SilkTest Runtime Options or within the Testscript file.

    Specifying Verify2Res.inc in the SilkTest Runtime Options for usage across SilkTest project:
        1.    From SilkTest, goto Options | Runtime
        2.    In the 'Use files' section, add 'Verify2Res\Verify2Res.inc'

    Specifying Verify2Res.inc in SilkTest Frame/Testscript file for usage in a single SilkTest project:
        1.    Add the following line at the beginning of the Frame/Testscript file
            use "Verify2Res\Verify2Res.inc"



Below are example testcases to demonstrate the type of results Verify2Res will produce compared to the default Verify method.

Examples using default Verify method:

// testcase to test default Verify method
testcase TestVerifyPass() appstate none
    WINDOW wWin = FindDomTextField("/BrowserApplication//BrowserWindow//INPUT[@id='txt_2']")
    Verify(wWin.GetProperty("disabled"), true, "control is disabled")

Result:

Script test.t - Passed
Machine: (local)
Started: 07:21:10PM on 22-May-2013
Elapsed: 0:00:01
Passed:  1 test (100%)
Failed:  0 tests (0%)
Totals:  1 test, 0 errors, 0 warnings

Testcase TestVerifyPass - Passed


// testcase to test default Verify method
testcase TestVerifyFail() appstate none
    WINDOW wWin = FindDomTextField("/BrowserApplication//BrowserWindow//INPUT[@id='txt_2']")
    Verify(wWin.GetProperty("disabled"), false, "control is disabled")

Result:

Script test.t - 1 error
Machine: (local)
Started: 07:22:02PM on 22-May-2013
Elapsed: 0:00:02
Passed:  0 tests (0%)
Failed:  1 test (100%)
Totals:  1 test, 1 error, 0 warnings

Testcase TestVerifyFail - 1 error
    *** Error: Verify control is disabled failed - got TRUE, expected FALSE
    Occurred in Verify
    Called from TestVerifyFail at test.t(19)


Examples using Verify2Res method:

// testcase to test new Verify2Res method
testcase TestVerify2ResPass() appstate none
    WINDOW wWin = FindDomTextField("/BrowserApplication//BrowserWindow//INPUT[@id='txt_2']")
    Verify2Res(wWin, "disabled", true, "control is disabled", true)
    // Verify2Res(wWin, "disabled", true, "control is disabled") // if parameter log2Res is not specified, the value is defaulted to True

Result:

Script test.t - Passed
Machine: (local)
Started: 07:23:49PM on 22-May-2013
Elapsed: 0:00:01
Passed:  1 test (100%)
Failed:  0 tests (0%)
Totals:  1 test, 0 errors, 0 warnings

Testcase TestVerify2ResPass - Passed
    Verify control is disabled passed - got TRUE, expected TRUE


// testcase to test new Verify2Res method
testcase TestVerify2ResFail() appstate none
    WINDOW wWin = FindDomTextField("/BrowserApplication//BrowserWindow//INPUT[@id='txt_2']")
    Verify2Res(wWin, "disabled", false, "control is disabled", true)
    // Verify2Res(wWin, "disabled", false, "control is disabled") // if parameter log2Res is not specified, the value is defaulted to True

Result:

Script test.t - 1 error
Machine: (local)
Started: 07:24:47PM on 22-May-2013
Elapsed: 0:00:01
Passed:  0 tests (0%)
Failed:  1 test (100%)
Totals:  1 test, 1 error, 0 warnings

Testcase TestVerify2ResFail - 1 error
    *** Error: Verify control is disabled failed - got TRUE, expected FALSE
    Occurred in Verify
    Called from Verify2Res at Verify2Res\Verify2Res.inc(17)
    Called from TestVerify2ResFail at test.t(37)



Attachments:

6675.Verify2Res.zip

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-07-08 10:53
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.