During a Pap smear, your doctor can also collect samples of fluid from the cervix to test for human papillomavirus. The primary purpose of a Pap smear is to examine your cervix for cell changes that could progress into cervical cancer. However, since cell changes are often caused by the human papillomavirus, Pap smears can also detect whether an individual has HPV. Pap smears are unable to test for any other sexually transmitted disease or infection accurately.