There is a test, but not of semen, it's done with expressed prostatic fluid.
Bacterial Prostatitis (about 15% of cases of Prostatitis) often results in no bacteria showing up in either urine or semen, because the areas of infection have got themselves blocked off by the infection. In this case, a urologist will massage the prostate to get some prostatic fluid and infection for culturing. This sometimes has to be done under general anesthetic because prostatitis can be too painful otherwise.
It can be very difficult to find a urologist who is competent in dealing with Prostatitis, it's something very few urologists specialise in.