When we had rats, I noticed that they almost always went to the bathroom in the same corner of the cage all the time.

So, I took a small plastic box, filled the bottom with sand, and put wood shavings on top of the sand. I also took some of the bedding they had already peed on and put it in there, too. Then I put it back in the corner.

They always used their "litterbox" after that! I think rats are, by nature, very clean animals.