After pressing D after startup it went on some Internet mode searching for a long time and i didn't know what to do....
Try Option-D. It may take some times because of Internet connection issue.
Use Apple's Online Hardware Test to Diagnose Problems With Your Device
The Apple Hardware Test (AHT) can troubleshoot your Mac's hardware issues. Using AHT over the internet runs the test without needing local media.
www.lifewire.com