You are going to get a ton of different responses to if it hurt.
For some people it kills for others it is not the least bit painful.
For me... I was in between. It was just uncomfortable.
About the test itself... this was what I experienced. Mine was done at a local hospital. I went in, they called my name and then had me go to a locker room. Pants and undies came off...shirt stayed on. They gave me a robe and then I went to a semi-private waiting room. They came to get me and brought me to a huge room with tons of equipment.

It was just me my doctor and another lady who I assumed was a nurse but she could have just been a tech. She had the test done herself not long before that so she was VERY reassuring.
They had me lay on a table and then put my knees up. They didn't have stirrups. That was kinda nice for a change to not feel like I am going to fall off the table butt first! Anyways... then they had me open my leggs and they inserted a small catheter in through the cervix. That was okay...no pain at all. Then they put the dye in. That part was a little uncomfortable from the pressure of the dye, but not painful. They then swung this thing over the top of my middle that was the x-ray machine. It reminded me of the dentist office when they swing that big light towards your mouth. They had me slowly roll from side to side to get the dye into both tubes. After that they took the catheter out, gave me a pad for the sticky black discharge (It looks like iodine) and sent me to get dressed. It took about 10 minutes for the test and about 20 mintes total from when we got to the hospital.
I had that black stuff coming out for a day or so. No bleeding. My tubes were open and I did conceive the cycle after that! They say it increases your chances for about 3 months.
I hope that helps.... if you have any questions... just ask