The development of biped robots has gained much research attention in recent years due to their capacity and flexibility in providing assistance to human. In practical applications, these robots are expected to walk on various types of ground surfaces. Balance control of bipedal walking on uneven terrain is still a challenging problem. This paper proposes a novel gait compensating method using sensory data tracking such that a robot can keep balance and walk on slope surfaces. The realtime compensation control system works to adjust the gait and thus make online sensory data to track the stored target sensory data, which are obtained from the robot when it walks on a flat surface. While the robot adjusts its gait to make online sensory data similar to those on a flat surface, it will achieve a stable pose in walking. The proposed method has been tested for several slopes using the NAO robot. The robot can adjust its pose automatically on slope surface according to the proposed method. An experiment on transition slopes further validates that the method can be extended to more general terrain variations for biped walking.