In order to obtain a high testing precision in the measurement of optical surfaces and focal length of a long focal length lens at the same time, the Computer-generated Holograms(CGH) method was presented by adding a diffractive optical element in the spherical optical path. Firstly, the optical surface test formula and the focal length test formula of the long focal length lens were derived, and the error of the focal length test formula was analyzed. In Zemax, the optical surface and focal length of a lens were tested with the CGH, which should be etched on a flat glass substrate, the PV value of the optical surfaces interference pattern is 0.003 4λ, and the test precision of the focal length is -0.11%. Finally, the influences of two errors on the test result were analyzed particularly, and the influence is no more than 0.1λ for the position error of the two optical elements and about 0.01λ for the fabrication error of CGH, where the radial position error is about 2 μm and the step error is about 5 nm. Considering the effects of all test errors, the test precision of the method can be controlled within 2λ/25.