Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Adobe Dreamweaver

  • Print
  • + Share This
This chapter is from the book

Validating and Testing Your Code

Once you've completed a page, you can use Dreamweaver to verify that the page is valid—in other words, that it follows the rules for its document type. You can validate page markup for any file, or validate XHTML and XML files as XML.

You can also use Dreamweaver to test your pages by verifying support for target browsers, testing for broken links, and generating reports.

Before you validate your pages, however, you need to use the Validator Preferences pane to configure your validation.

To select Validator preferences:

  1. From the Edit menu (Windows) or the Dreamweaver application menu (Mac), select Preferences. The Preferences dialog appears.
  2. Select the Validator category from the list on the left. The Validator pane appears ( Figure 3.41 ).
    03fig41.jpg

    Figure 3.41 The Validator pane of the Preferences dialog.

  3. On the Validator pane, select languages to validate your pages against.
  4. Click the Options button to display the Validator Options dialog ( Figure 3.42 ).
    03fig42.jpg

    Figure 3.42 The Validator Options dialog.

  5. Deselect any Display options that you don't want the Validator report to include (all options are selected by default).
  6. Deselect any options that you don't want the Validator to check for (both options are selected by default). Both of these options pertain to character entities. If you want Dreamweaver to check for quotation marks and characters (&, <, and >) in your HTML, leave these options selected.
  7. Click OK to save your selections and close the Validator Options dialog.
  8. Click OK on the Validator pane to save your selections and close the Preferences dialog.

To validate markup:

  1. Open an HTML page in Dreamweaver.
  2. From the File menu, choose Check Page > Validate Markup, or press Shift-F6. The Validator report displays on the Validation panel in the Results panel group at the bottom of the Dreamweaver workspace ( Figure 3.43 ).
    03fig43.jpg

    Figure 3.43 Choose Check Page > Validate Markup to display the Validator report in the Results panel group.

  3. If you want to view the full text of any error or warning in the Validator report, click the More Info button.

To validate as XML:

  1. Open an XHTML or XML file in Dreamweaver.
  2. From the File menu, choose Check Page > Validate as XML. The Validator report displays on the Validation panel in the Results panel group at the bottom of the Dreamweaver workspace.

Verifying support for target browsers

In addition to validating your pages, you can also test your code with a browser check in your choice of target browsers.

To verify support for target browsers:

  1. Open your page in Dreamweaver.
  2. On the Document toolbar, click the Check Browser button to the right of the title field ( Figure 3.44 ).
    03fig44.jpg

    Figure 3.44 Click the Check Browser button on the Document toolbar to open the Check Browser menu.

    The Check Browser menu opens ( Figure 3.45 ).
    03fig45.jpg

    Figure 3.45 The Check Browser menu.

  3. From the Check Browser menu, select Settings. The Target Browsers dialog opens ( Figure 3.46 ).
    03fig46.jpg

    Figure 3.46 Select target browsers in the Target Browsers dialog.

  4. In the Target Browsers dialog, select the minimum version of each browser you want to use for testing your pages. Click OK to save your settings and close the dialog.
  5. Click the Check Browser button again to display the menu. Select Check Browser Support to test the open page.
  6. The results display on the Target Browser Check panel in the Results panel group ( Figure 3.47 ).
    03fig47.jpg

    Figure 3.47 View the browser-support results on the Target Browser Check panel.

Troubleshooting your code

You can also troubleshoot your code by checking your site for broken links and by using Dreamweaver reports.

To check for broken links:

  1. Open your page in Dreamweaver.
  2. From the Site menu, choose Check Links Sitewide, or press Ctrl-F8 (Windows) or Command-F8 (Mac).
  3. View the results on the Link Checker panel in the Results panel group ( Figure 3.48 ).
    03fig48.jpg

    Figure 3.48 View details on broken links on the Link Checker panel when you check links sitewide.

To use Dreamweaver reports:

  1. Open your page in Dreamweaver.
  2. From the Site menu, choose Reports. The Reports dialog displays ( Figure 3.49 ).
    03fig49.jpg

    Figure 3.49 Choose Reports from the Sites menu to display the Reports dialog.

  3. In the Report On drop-down menu, select Current Document to test a single page, or Entire Current Local Site (if you have defined a Dreamweaver site).
  4. In the Select Reports section, select the items you want to test in the Workflow and HTML Reports sections.
  5. Click the Run button to run the report.
  6. View the report results on the Site Reports panel in the Results panel group ( Figure 3.50 ).
    03fig50.jpg

    Figure 3.50 View report results on the Site Reports panel.

  • + Share This
  • 🔖 Save To Your Account