I get chest pains frequently, but when I go to the doctor, I'm not in pain. What should I do?

Stress test. Would recommend a stress test, to rule out your heart as the cause of the pain. If normal, can then see if due to your lungs (pleurisy), your esophagus (acid reflux), your chest muscles, your ribs, or nerves from your upper back getting pinched by a disk hernia or arthritis of your spine.
Tell your doctor. It is important to tell your doctor the details surrounding your chest pain, regardless of whether you have it at the time or not. Your doctor will then determine whether more testing, or consultation with a cardiologist, is needed.