There is no diagnostic test for ED. On occasion, a urologist will have a patient do a nocturnal penile tumescence (NPT) test, which can indicate if he is having spontaneous erections during sleep, or a penile plethysmograph, which evaluates blood flow to the penis in response to arousing material.