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

Executing Silk Test Workbench tests on multiple browsers sequentially

Executing Silk Test Workbench tests on multiple browsers sequentially

It is possible to execute Silk Test Workbench tests on mulitple browsers (Internet Explorer, Firefox, and Google Chrome) sequentially by utitilsing the solution provided in this article.

This article provides the necessary configurations to setup either a Visual Test, VB.NET script, or a Master Visual Test or VB.NET script to execute test(s) on multiple browsers sequentially.  Find attached STWB_MultiBrowserTest.zip and STWB_MultiBrowserTest_ProjectExample.zip, contents of which are as follows:

    - STWB_MultiBrowserTest.zip

        1) This archive contains a project export, 'STWB_MultiBrowserTest.xml', of the following VB.NET scripts
            
            - ClearCurrentBrowser
            - GetBrowser
            - SetupBrowser

        2) You will also find in this archive a folder, 'ActiveData Files', which contains the following Excel files required by the ActiveData assets of the project export:

            - Browsers.xlsx
            - CurrentBrowser.xlsx

    - STWB_MultiBrowserTest_ProjectExample.zip

        1) This archive contains both Visual Test and VB.NET script example project (TestingMultipleBrowsers) export, 'STWB_MultiBrowserTest_ProjectExample.xml', of templates to assist with applying the necessary configuration to use the solution.


We will first look at the setup requirements for Visual Tests:

    Master Visual Test requirements:

        1) Must contain a local variable (of Text)
            - BrowserType (this variable will store the current browser at runtime)
        
        2) Must contain a repetition logic in step 2 that utilises the Common.ListOfBrowserTypes ActiveData object

        3) Must call the ClearCurrentBrowser VB.NET script in step 3

        4) Must contain an expression to store the browser type value for the ActiveData Common.ListOfBrowserTypes in the local variable BrowserType in step 4

        5) Must call the SetupBrowser VB.NET script in step 5

        6) Must call the ClearCurrentBrowser VB.NET script in the last step inside the repetition logic created above.


Master Visual Test template


    Visual Tests to be called by the Master Visual Test

        1) Create an application configuration for all the supported browsers
        Below is the application configuration requirements for each browser type:
            
            a) Internet Explorer
                - Browser = None
                - Process name = C:\Program Files (x86)\Internet Explorer\iexplore.exe
                - Locator = /BrowserApplication[@browsertype='Internet Explorer']
                - Url = <specify>
                - Timeout = 30000
                - Execute base state = False

            b) Firefox
                - Browser = None
                - Process name = C:\Program Files (x86)\Mozilla Firefox\firefox.exe
                - Locator = /BrowserApplication[@browsertype='Firefox']
                - Url = <specify>
                - Timeout = 30000
                - Execute base state = False

            c) Google Chrome
                - Browser = None
                - Process name = %USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe
                - Locator = /BrowserApplication[@browsertype='Google Chrome']
                - Url = <specify>
                - Timeout = 30000
                - Execute base state = False

        2) Must call the GetBrowser VB.NET script in step 2


Visual Test template to be called by Master Visual Test


    Standalone Visual Test

        1) The requirements for a standalone visual test is a combination of the the requirements of a Master Visual Test and a Visual Test to be called by the Master Visual Test.


Standalone Visual Test template



The setup requirements for VB.NET scripts are as follows:

    Master Script

        1) See the example script TestingMultipleBrowsers.MasterDotNetScript template in STWB_MultiBrowserTest_ProjectExample.zip project export.


    Scripts to be called by the Master Script

        1) Create an application configuration for all the supported browsers
        Below is the application configuration requirements for each browser type:
            
            a) Internet Explorer
                - Browser = None
                - Process name = C:\Program Files (x86)\Internet Explorer\iexplore.exe
                - Locator = /BrowserApplication[@browsertype='Internet Explorer']
                - Url = <specify>
                - Timeout = 30000
                - Execute base state = False (uncheck)

            b) Firefox
                - Browser = None
                - Process name = C:\Program Files (x86)\Mozilla Firefox\firefox.exe
                - Locator = /BrowserApplication[@browsertype='Firefox']
                - Url = <specify>
                - Timeout = 30000
                - Execute base state = False (uncheck)

            c) Google Chrome
                - Browser = None
                - Process name = %USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe
                - Locator = /BrowserApplication[@browsertype='Google Chrome']
                - Url = <specify>
                - Timeout = 30000
                - Execute base state = False (uncheck)

        2) Must call the GetBrowser VB.NET script following the Main subroutine declaration using Workbench.RunScript method.


    Standalone Script

        1) The requirements for a standalone script is a combination of the the requirements of a Master Script and a Script to be called by the Master Script.



Attachments:

4604.STWB_MultiBrowserTest.zip

Example project files:

6472.STWB_MultiBrowserTest_VBNet_ProjectExample.zip

3482.STWB_MultiBrowserTest_VisualTest_ProjectExample.zip

Complete solution with example project files:

7380.STWB_MultiBrowserTest_Complete.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:44
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.