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 can SilkTest toggle between two browser windows with the same title caption?

How can SilkTest toggle between two browser windows with the same title caption?

This can cause problems as SilkTest can treat both browsers as the same Window, causing the testcases to fail. Start by having the two browsers open and loaded with the webpages of the same name. To ensure the success of your tests, do not have other browsers opened which are unrelated to the tests. Then use the code below to toggle between the windows:

Browser.SetActive( )  //This sets the first page active
Browser.Minimize( )    //this minimizes the active page
        
Browser.SetActive( )  //This sets the second page active
Browser.Minimize( )    //this minimizes the second active page
    
Browser.SetActive( ) //this sets the first page active again

In this example the two pages have the same title, normally this would cause a problem in testcase playback, especially if you use the testcase or action recorder.

To work around it and toggle between pages of the same title simply minimise the browser currently open and set the browser to active again, it will toggle between the two open pages by minimizing one and setting active the next.

Old KB# 21641

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