Phase-measuring deflectometry is a full-field gradient measuring technique that lends itself very well to testing specular optical surfaces. We have measured the deformation of the surface of a lens by transmission deflectometry with liquids. In this study, a method is proposed for measuring the refractive index distribution of a transparent object component. The proposed method combines transmission deflectometry with liquids. The deformed fringe patterns of a sample immersed in different fluids are recorded, and then the three-dimensional phase information of the sample is reconstructed numerically. We have used phase-shifting and temporal phase-unwrapping methods to retrieve the phase from the measured deformed fringe pattern, and we have used a least-squares method to find the height information of the specular surface from the calculated slope. In particular, we have proposed a theoretical model for determining the refractive index of sample and planar convex lens are demonstrated experimentally.