Prior to his ascension, Cao Rui served as a military officer under his father Cao Pi. He was an unexceptional, if competent, leader. He spent most of his military career guarding Luo Yang and was not involved in any major battles.
Cao Rui took the throne after the death of his father, over the objections of the imperial advisors who wished to crown Cao Pi's cousin Xiahou En. It is believed that his selection was influenced by Cao Pi's family.
He was an ineffectual ruler, both in military and domestic affairs. His advisors pushed him to press the attack on Liu Shan. Cao Rui ignored them, opting to fight defensively. As a result, Liu Shan was able to easily surround the capital. It is likely that his poor reputation among the people also aided to his defeat, as many officers deserted or surrendered rather than fight.