Creating a Test for a Web Application

Before you can create a Silk4J test, you must have created a Silk4J project.

To record a test for a web application:
  1. In the Package Explorer, select the project to which you want to add the new test.
  2. In the toolbar, click Record Actions.
  3. Select the browser that you want to use.
  4. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
  5. Optional: Select an Orientation for the browser window.
  6. Click Record. The application under test and the Silk Recorder open. Silk4J creates a base state and starts recording.
  7. Optional: To record WebDriver locators instead of recording Silk4J locators, click WebDriver in the Silk Recorder. This feature is available when recording against one of the following browsers:
    • Microsoft Edge
    • Mozilla Firefox
    • Google Chrome
    • Apple Safari
    For additional information, see Using Selenium WebDriver.
  8. In the application under test, perform the actions that you want to test.
    For information about the actions available during recording, see Actions Available During Recording.
  9. Click Stop. The Record Complete dialog box opens.
  10. 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.
  11. Optional: In the Package text box, specify the package name.
    For example, type: com.example. To use an existing package, click Select and select the package that you want to use.
  12. In the Test class text box, specify the name for the test class.
    For example, type: AutoQuoteInput. To use an existing class, click Select and select the class that you want to use.
  13. In the Test method text box, specify a name for the test method.
    For example, type autoQuote.
  14. Click OK.

Replay the test to ensure that it works as expected. You can modify the test to make changes if necessary.