There are 6-7 black lesions/ nodules on my scalp for 5 years. My father had them too (benign). I have dandruff and oily skin. Any diagnostic tests?

Likely biopsy,,, Your best diagnostic test here would likely be biopsy of these lesions by a dermatologist. These would then be sent to a lab for analysis, and the report would go back to the doctor to discuss with you. Good luck.