How to get clomid?

How easy was it for you doctor to prescribe you with clomid? Did you have to go through extensive testing? Was your SO tested? Is there a generic alternative over the counter? Thank you!