How to Test Your Files on Your Hard Drive
- Build your Web page and save it to your hard drive.
- Open your Web browser and go to the File menu and choose "Open".
- Browse to the file you saved on your hard drive.
There are a few things that may go wrong when testing your Web pages on your hard drive rather than the Web server. Make sure that your pages are set up correctly for testing:
- Use fully-qualified absolute paths for links.
You can use page-relative paths for your links, but the best way to test links before a page is live is to use the full path to the page you're linking to. In other words, include the domain name in your links.
- Use page-relative paths for your images.
While you can use the full URL for your images, if the page you're testing is new, then chances are that your images aren't uploaded to the server any more than the HTML is. By using paths to images that are relative to the current page, they will show up when you test the file on your hard drive.
There isn't a good rule of thumb for using full-path or relative-path URLs for scripts and CSS files – it depends upon your site and what works best for you. Instead, you should verify that whatever file you're pointing to has the most up-to-date information. For example, if you post to a full-path URL for your CSS, you'll need to upload that file to your server when you test.
Be Sure to Test in Multiple Browsers
Once you've browsed to your page in one browser, you can then copy the URL from the Location bar in the browser and paste it into other browsers on the same computer. When I build on my Windows machine, I test my pages in the following browsers before I upload anything:
- Internet Explorer
- Safari (beta)
Once you're sure the page looks right in the browsers you have on your hard drive, you can upload the page and test it again from the Web server. Once it's uploaded, you should connect to the page with other computers and operating systems or use a browser emulator like BrowserCam to do extensive testing.
Posted in: Web Design and Applications