Configuring a Visual Test to Launch an Application that Uses the Java Network Launching Protocol (JNLP)

Applications that start using the Java Network Launching Protocol (JNLP) require additional configuration in Silk Test Workbench. Because these applications are started from the Web, you must manually configure the application configuration to start the actual application as well as the application that launches the "Web Start". Otherwise, the visual test will fail on playback unless the application is already running.

  1. Record a visual test for the application that you want to test.
  2. Click the <<Start>> step in the Task pane.
  3. In the Properties pane, navigate to the Application Configurations category.
  4. Click the Application Configurations field and then click Add Application Configuration. The Select Application dialog box appears.
  5. Select the Windows tab.
  6. Select the Java application that you want to test.
  7. Click OK. Silk Test Workbench adds the new application configuration.
  8. Modify the first application configuration, Config 1, to use the javaws.exe to download and launch the Web Start.
    1. Click into the Config 1 field and click Edit Application Configuration.
    2. In the Executable field, type the executable name and file path of the Web Start. For example, you might type %ProgramFiles%\Java\jre6\bin\javaws.exe.
    3. In the Working directory field, type a temporary directory location for the file that you will download. For example, you might type C:\temp where temp is a directory on your local C drive.
    4. In the Locator field, specify the locator that identifies the main window of the application that you are testing.
      In most cases, you will not have to change this because when you recorded the visual test, the correct locator was recorded. For example, if you are testing the SwingSet3 JNLP application, the locator is SwingSet3.
    5. In the Command Line Arguments field, type the JNLP URL that starts the test application. For instance, to use the SwingSet3 JNLP application, type http://download.java.net/javadesktop/swingset3/SwingSet3.jnlp.
    6. Delete any value in the Command Line Pattern field.
    7. To change the number of milliseconds that Silk Test Workbench attempts to find the locator that is specified for the base state before timing out, type a value into the Timeout field.
      By default Timeout (milliseconds) is set to 30000, which is sufficient for most applications.
    8. Leave the Execute base state text box set to True
  9. Modify the new application configuration to use the Java application that you want to test.
    1. In the Executable field, type the executable name and file path of the application that you want to test. For example, to use the SwingSet3 JNLP application, type *\javaw.exe.
    2. Leave the Working directory field empty.
    3. In the Locator field, specify the locator that identifies the main window of the application that you want to test. In most cases, this matches the name of the locator that you specified in Config 1. For example, if you are testing the SwingSet3 JNLP application, the locator is SwingSet3.
    4. Delete any value in the Command Line Arguments field.
    5. In the Command Line Pattern field, type the command line arguments pattern for the test application.
      An application configuration that contains a command line arguments pattern enables only processes for testing that match both the process name and the command line arguments pattern. If no command line arguments pattern is defined, all processes with the specified process name executable pattern are enabled. For instance, to use the SwingSet3 JNLP application, type *SwingSet*. This argument ensures that only the SwingSet3 Java application is launched.
    6. To change the number of milliseconds that Silk Test Workbench attempts to find the locator that is specified for the base state before timing out, type a value in the Timeout text box. By default Timeout (milliseconds) is set to 30000, which is sufficient for most applications.
    7. Check the Execute Base State check box.
When you playback the visual test, the JNLP application starts as expected.