Press and hold the D key before the gray startup screen appears. An Internet-enabled connection via Ethernet or Wi-Fi is required to use this feature.Note: Some Macintosh computers that shipped with OS X Lion support the use of Apple Hardware Test over the Internet. These computers will start up to an Internet-based version of AHT if the hard drive does not contain AHT.

It takes a minute or so for Apple Hardware Test to start up and inspect your hardware configuration. While this is taking place, an icon appears on the screen:

When the process is complete, select your language and click the right arrow. If you aren't using a mouse, you can use the up and down arrows to select a language and then press the Return key.

The Apple Hardware Test console appears. You can choose which sort of test or tests to perform:

To perform all of the basic tests, click the Test button or press the "T" key or the Return key.

To perform a more thorough diagnostic test, select the "Perform extended testing" checkbox under the Test button before you click the Test button.

Your test results will appear in the window in the bottom-right of the console.