Configuring a Script to Launch in a New Browser Window

At times you may want to launch a separate browser window for a script rather than using the existing browser window. For instance, when you execute a Silk Test Workbench script from Silk Central Test Manager, the script uses the existing Silk Central window. To return to Silk Central, the user must click Back in the browser window. To avoid this behavior you can configure your script to launch a separate browser window for tests that you will execute from Silk Central.

  1. Open the script in which you want to include the code to start the application.
  2. If your script uses a base state, perform the following steps:
    1. In the Properties pane, navigate to the Application Configurations category.
    2. Double-click on the application configuration that you want to modify. The Edit Application Configuration dialog box opens.
    3. Uncheck the Execute base state check box.
  3. Type Imports System.Diagnostics at the beginning of the script.
  4. To define the application as a new process, type:
     Dim applicationProcess As New Process() 
    where applicationProcess is the name of the application that you want to start. For example, to start Internet Explorer, type:
    Dim ieProcess As New Process()
  5. Define the full path to the application by typing the following code:
    Dim psi As New ProcessStartInfo()
    psi.FileName = "applicationexecutable.exe"
    where applicationexecutable.exe is the name of the executable file that launches your test application. For example to start Internet Explorer, type:
    Dim psi As New ProcessStartInfo()
    psi.FileName = "C:\Program Files\Internet Explorer\iexplore.exe"
    Note: If the executable for the application that you want to test is in the same directory as Silk Test Workbench, you do not need to specify the full path.
  6. To open the Web application that you are testing, set the ProcessStartInfo.Arguments property to the URL. For example, to start Internet Explorer and test the sample Web application, add the following line after the Filename line:
    psi.Arguments = "http://demo.borland.com/InsuranceWebExtJS/index.jsf"
  7. Specify the code to start the process. For example, to start ieProcess, type:
    ieProcess.StartInfo = psi
    ieProcess.Start()
  8. Save the script.