In an HSG test, liquid dye is inserted by a catheter through the vagina (cervix) into the uterus. Then, X-rays are taken to see if there is a blockage or if the dye flows freely into the abdomen.