Customizing Your Web Application Tests

To perform the actions described in this topic, the following prerequisites are required:
  • To be able to record tests with Silk4J, a current version of Internet Explorer needs to be installed on your system. For a list of the supported versions, refer to the Release Notes.
  • For a list of the supported browsers for replay, refer to the Silk Test Release Notes.
  • To test against mobile browsers, you need to install an emulator on your system or connect a mobile device to your system. For additional information on testing mobile web applications, refer to the Mobile Testing Tutorial.
After you have created a project for a Web application, you can add additional tests or enhance the existing tests to test additional functionality of the Web application.
  1. To open a project in Eclipse, perform one of the following:
    • On the Silk Central Connect panel, click Open with Silk4J in the Action column that corresponds to the project.
    • On the overview page of the project, click Open with Silk4J.
    When creating a Silk Central Connect project, an Eclipse project template is committed to your specified source control, containing the following assets:
    • src folder: The location where new tests are stored
    • Lib folder: To use additional java libraries in your Silk4J project, add them to this folder. Silk Central Connect adds all jar files that are located in this folder to the classpath when executing the tests.
    • build.xml: A preconfigured ANT build file that Silk Central Connect uses to build the tests before execution.
    • Other Eclipse-related files
  2. Record additional tests in Silk4J.
    1. In the Package Explorer, select the project to which you want to add the new test.
    2. On the toolbar, click Record Actions.
      • If a Silk4J test class is open in Eclipse, the recorded actions are recorded into this file.
      • If no Silk4J test class is open in Eclipse, the recorded actions are recorded into a new Silk4J test class file.

      The Web application and the Recording window open. Silk4J creates a base state and starts recording.

    3. Perform the steps that you want to record against the AUT.
    4. Click Stop Recording. The Record Complete dialog box opens.

    5. The Source folder field is automatically populated with the source file location for the project that you selected. To use a different source folder, click Select and navigate to the folder that you want to use.
    6. Optional: In the Package field, specify the package name. To use an existing package, click Select and select the package that you want to use.
    7. In the Test class field, specify the name for the test class.
    8. In the Test method field, specify a name for the test method.
    9. Click OK.

    For information about Silk4J, refer to the Silk4J User Guide.

  3. Ensure that the test works as expected in Silk4J.
    1. On the Silk4J toolbar, click Run selected Silk4J test(s).
    2. On the Select Browser dialog box, select the browser on which you want to replay the test.

    3. Click Run. If the test passes and the test results look as expected, you can add the test to the test set for the project in Silk Central Connect.
  4. On the Silk4J toolbar, click Commit to commit the changes in the project to the repository.
  5. Back on the overview page of the project in Silk Central Connect, click Run Tests to execute all tests in the project.
  6. Select the configurations.

  7. Click Run Tests.
  8. When the execution is finished, click on the start time link. You can see the test result for every test and every configuration.

If all tests have run as expected on all configurations, you can further enhance the test set or schedule the project for repeated execution.