A human papillomavirus (HPV) test is done to check for a high-risk HPV infection in women. HPV is a sexually transmitted infection (STI) . An HPV test checks for the genetic material (DNA) of the human papillomavirus. Like a Pap test, an HPV test is done on a sample of cells collected from the cervix.