At present, there is no definitive test for insomnia. Nonetheless, intelligent doctors may use various tools to diagnose and measure the symptoms. Also, the doctor concerned may ask some relevant questions and have you fill out some questionnaires too!