To find out why there is discharge from the urethra (the tube through which urine exits the body), a healthcare provider may do a urethral swab test to collect a sample and test for infection.