Hysterosalpingogram. A hysterosalpingogram (HSG) is an X-ray test that looks at the inside of the uterus and fallopian tubes and the area around them. It often is done for women who are having a hard time becoming pregnant (infertile).