Recording a Test for the Insurance Company Web Application

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

Record a new test that navigates to the Agent Lookup page in the Insurance Company web application, For a detailed version of how to record a test and how to configure test applications for each technology type, see the Creating Tests section of the Silk4J User Guide.

  1. In the toolbar, click Record Actions.
  2. Select the browser that you want to use.
  3. Click Record. The application under test and the Silk Recorder open. Silk4J creates a base state and starts recording.
  4. In the Insurance Company Web site, perform the following steps:
    1. From the Select a Service or login list box, select Auto Quote.
      The Automobile Instant Quote page opens.
    2. Type a zip code and email address in the appropriate text boxes, click an automobile type, and then click Next. For example, type 92121 as the zip code, as the email address and specify Car as the automobile type.
    3. Specify an age, click a gender and driving record type, and then click Next. For example, type 42 as the age, specify the gender as Male and Good as the driving record type.
    4. Specify a year, make, and model, click the financial info type, and then click Next. For example, type 2010 as the year, specify Lexus and RX400 as the make and model, and Lease as the financial info type. A summary of the information you specified appears.
    5. Point to the Zip Code that you specified and press Ctrl+Alt to add a verification to the script. You can add a verification for any of the information that appears. The Select Verification Type dialog box opens.
    6. Select whether you want to create a verification of a property or an image verification. For the tutorial, select Verify properties of the TestObject. The Verify Properties dialog box opens.
    7. Check the TextContents check box and then click OK. A verification action is added to the script for the zip code text.
    8. Click Home.
    An action that corresponds with each step is recorded.
  5. Click Stop. The Record Complete dialog box opens.
  6. 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.
  7. 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.
  8. 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.
  9. In the Test method text box, specify a name for the test method.
    For example, type autoQuote.
  10. Click OK.

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