Testing the validation functionality

This section explains the testing of the validation functionality.

Procedure

  1. Start the test environment.
  2. Navigate to the Stores > WebContent > Madisons_name directory.
  3. Right-click the index.jsp file and select Run > Run on Server.
  4. A message might display asking you to select a server. Select Choose an existing server and click Finish.
  5. Alternatively, to directly launch the index.jsp, you can enter the following URL directly in your Web browser:
    
    http://localhost/webapp/wcs/stores/servlet/Madisons/index.jsp 
    
  6. At the bottom of the store home page that is displayed, click Help/Contact Us.
  7. You should see your custom Contact Us page with an input form.
  8. Leave all the fields blank and click Submit. You should receive a message that a validation error occurred.

    Validation errors with all fields blank
  9. Type your name in the Name field, leave the other fields blank, and click Submit. You should receive a message that a validation error occurred.

    Validation error with a valid name.
  10. Type your name in the Name field, abc@xyz in the Email address field, and click Submit. You should receive a message that a validation error occurred.
    Validation error for invalid email address
  11. Type your name in the Name field, abc@xyz.com in the Email address field, This is my comment. in the Comment field, and click Submit. You should see the Contact Us Acknowledgment page display with your name obtained from the input form.
    Contact us acknowledgement page.