Is there a test for herpes?

Yes. Multiple tests. Skin biopsy of active lesions, culture of fluid from lesions, pcr or antibody tests on active lesions. Blood tests as well.
Yes. Sores on the body can be scraped and the samples sent to a lab to look for herpes virus infected cells. The sores can also be swabbed and the samples sent for viral culture or viral dna analysis. Also, a person's blood can be checked for antibodies to herpes type 1 or type 2 viruses (positive antibodies means a person has had the infection at some time).