It depends on what it's being done for. If they are looking for reasons for infertility, they might not test for infection. They will be probably looking for motility (the movement of sperm), the number of sperm, and the shape of sperm.
https://www.healthline.com/health/semen-analysis
If they find any issues with any of these, they might do further testing, like for infection, but it's not a normal first step. STD testing, by urine, might be a step that's done at some point, but semen testing for STDs isn't as accurate as urine testing.
They will check how much or the volume you nut, such as how many millilitres you spoof, then they check the motility of the sperm also mortality of the sperm (what percentage are dead or immobile [immotile] etc) the morphology of them (shape and formed correctly or not) and how many sperm cells per millilitre of nut; against the WHO standards.
Average is 60,000,000 per mill of nut, I checked mine because of covid jabs, I have 104,000,000 per mill of nut, so above average, so happy about that lol
A semen analysis, also called a sperm count, measures the quantity and quality of semen and sperm. Semen is the thick, white fluid released from the penis during sexual climax (orgasm). This release is called ejaculation. Semen contains sperm, the cells made in the male reproductive system that include the genetic material needed to make a baby.
You will need to provide a semen sample. For accurate results, the semen must be examined quickly before the sperm begin to die. For this reason, you will usually provide a sample in a private room at a lab by masturbating and collecting your semen in a sterile container. You may be asked to urinate (pee) and wash your hands and penis before collecting your sample. This will help keep bacteria from your skin out of the sample.
To get accurate results:
Don't use lubricants or saliva because they could harm your sperm.
Make sure to collect all the semen you produce. If you miss collecting even a bit of it, you should let your provider know.
If you prefer, you may be able to collect your sample at home during sex by using a special type of condom that your provider gives you. But you will have to keep the sample at body temperature and take it to the lab within 30 to 60 minutes after collecting it.
You may need to provide two or more semen samples within a week or two. That's because your sperm count and semen quality can vary from day to day.