The test requires a sample of the person’s genital, rectal or oral secretions. Depending on the location of the suspected infection, a urine sample, a swab of the genitals, rectum or throat, or a specimen obtained during a pelvic exam may be collected.