Never had one, but I'm a doctor, so I could tell you..
Have you ever had an ordinary ECG? They just put a bunch of stickers on your chest and connect a bunch of leads to it, and get a tracing of the electrical rhythm of your heart. It doesn't hurt at all!
They basically do the same thing but get you walking on a treadmill or riding a bike. They get you to build up gradually until you're working at a reasonable rate, to make sure that the heart is still coping well with the stress. If it brings on pain, or changes in the heart rhythm, then you may have some early heart problems - and then you would need medications. If your heart copes fine with the exercise, that's a very good sign that all is well!
None of this is painful at all, don't worry! You'll be fine