You can buy it at those test centers, ( i buy mine there, while having the car checked, in and out in 15min, they do all the leg work, for 200baht+50b and they send all docs back EMS to my house, if you don't want to collect yourself) and the government transport offices have agent/brokers inside also, you can do it on line but i prefer a place i can visit if any probs.
edit; Some of those test shops will also do the registration paperwork for you, if they are falang friendly.