A cortisol test estimates cortisol hormone levels in a 24-hour sample of urine. The cortisol level may indicate problems with the adrenal or pituitary glands. Distinct diseases, such as Cushing syndrome and Addison disease, can lead to either excess or too little production of cortisol. Estimating urine cortisol levels can help diagnose these conditions.