You can define the browser that is used for the replay of a test in the following ways:
- If you execute a test from the UI of
Silk Test Workbench and the
Select Browser dialog box displays, the browser selected in the dialog box is used, and
Silk Test Workbench ignores which browser is set in the test script.
- If the
Select Browser dialog box is disabled, because the
Don't show again is checked, the application configurations in the individual test scripts determine the browser that is used to execute the tests.
Note: To re-enable the
Select Browser dialog box, click
and
set the
Show Browser Configuration Dialog option to
Yes.
- If you execute a script from the command line or from a Continuous Integration (CI) server, specify the connection string in the application configuration of the script.
To overwrite the browser that is specified in the application configuration, use the
silktest.configurationName environment variable or the
browser command-line parameter.
-
If you execute a test from
Silk Central, create a configuration suite with a configuration for each browser that you want to test. Then specify the appropriate configuration name. For additional information, refer to the
Silk Central Help.
Examples of setting the browser by using the silktest.configurationName environment variable
- To use
Internet Explorer as the browser, type:
SET silktest.configurationName=InternetExplorer
STW.exe –script MyScript
- To use
Microsoft Edge as the browser, type:
SET silktest.configurationName=Edge
STW.exe –script MyScript
- To use
Mozilla Firefox as the browser, type:
SET silktest.configurationName=Firefox
STW.exe –script MyScript
- To use
Google Chrome as the browser, type:
SET silktest.configurationName=GoogleChrome
STW.exe –script MyScript
- To use
Apple Safari on a Mac as the browser, type:
SET silktest.configurationName=host=10.0.0.1 - Safari
STW.exe –script MyScript
In this example, the
host is the Mac, on which you want to test
Apple Safari. The host needs to be connected as a remote location to the machine on which
Silk Test Workbench is running. For additional information, see
Editing Remote Locations.
- To use
Google Chrome on an
Android device as the browser, use a connection string. For example, if the device ID is 11111111 and the device is connected to the remote machine with the IP address 10.0.0.1, type:
SET silktest.configurationName="platformName=Android;deviceName=MotoG3;deviceId=11111111;host=10.0.0.1 - Chrome"
STW.exe –script MyScript
- To use
Apple Safari on an
iOS device as the browser, use a connection string. For example, if the device ID is 11111111 and the device is connected to the remote machine with the IP address 10.0.0.1, type:
SET silktest.configurationName="platformName=iOS;deviceName=iPad mini;deviceId=11111111;host=10.0.0.1"
STW.exe –script MyScript
Additionally, you have to specify the browser in the application configuration.
Tip: For all examples, you can also set the browser by setting the Java System property
-Dsilktest.configurationName instead of setting the environment variable
silktest.configurationName. For example, to use
Apple Safari on a Mac as the browser, you can also type:
-Dsilktest.configurationName=host=10.0.0.1 - Safari
STW.exe –script MyScript
Tip: Open the
Select Browser dialog box, for example by starting to replay or record from the
Silk Test Workbench UI, to see a list of the browsers that are currently available on your system.
Examples of setting the browser by using the browser parameter
- To use
Internet Explorer as the browser, type:
STW.exe –browser InternetExplorer –script MyScript
- To use
Microsoft Edge as the browser, type:
STW.exe –browser Edge –script MyScript
- To use
Mozilla Firefox as the browser, type:
STW.exe –browser Firefox –script MyScript
- To use
Google Chrome as the browser, type:
STW.exe –browser GoogleChrome –script MyScript
- To use
Apple Safari on a Mac as the browser, type:
STW.exe -connectionstring host=10.0.0.1 - Safari –script MyScript
In this example, the
host is the Mac, on which you want to test
Apple Safari. The host needs to be connected as a remote location to the machine on which
Silk Test Workbench is running. For additional information, see
Editing Remote Locations.
- To use
Google Chrome on an
Android device as the browser, use a connection string. For example, if the device ID is 11111111 and the device is connected to the remote machine with the IP address 10.0.0.1, type:
STW.exe -connectionstring "platformName=Android;deviceName=MotoG3;host=10.0.0.1 - Chrome" –script MyScript
- To use
Apple Safari on an
iOS device as the browser, use a connection string. For example, if the device ID is 11111111 and the device is connected to the remote machine with the IP address 10.0.0.1, type:
STW.exe -connectionstring "platformName=iOS;deviceName=iPad mini;host=10.0.0.1" –script MyScript
Additionally, you have to specify the browser in the application configuration.