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

After my testcase completes SilkTest does not close all open browsers, what can I do?

After my testcase completes SilkTest does not close all open browsers, what can I do?

In some circumstances a testcase will open multiple Browser children windows during a testcase and sometimes these Browser Children don"t contain the browser menu which is used by default to close all open windows when SilkTest calls the TestCaseExit() function at the end of a testcase. Therefore, some of the Browser Children windows are not closed.

The way to customise this for an application under test is to override how the function TestCaseExit() closes all open browsers by NOT using the associated Close() function in its code but rather substitute the Alt-F4 combination used to close any active window.

By placing this newly revised function in the include file, the user effectively overrides the existing function. The new method code to paste into the include file is:

 [-] TestCaseExit (BOOLEAN bException) 
    [-] if (bException) 
        [ ] ExceptLog () 
    [-] while Browser.Exists() 
        [ ] Browser.TypeKeys("<Alt-F4>") 
    [ ] SetBaseState ()  

Old KB# 20760

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:13
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.