Not a wise idea to just pop some pills for a test.
If you do have anxiety in general, a betablocker can be very helpful (I've taken them before with great success). But you need to be on it long enough to know if side effects will be bothersome for you. You don't just pop one and head out the door to ace your test. The positive effects can be fairly quick, but betablockers do lower your blood pressure and your heart rate, so you shouldn't be fooling around with them.
No doctor who has any integrity whatsoever will give you a prescription for Ritalin or any other ADHD drug unless you've been diagnosed with ADHD. Ritalin is a stimulant, and if you don't actually have ADHD, it can hype you up and make you nervous. There are proven differences between an ADHD and normal brain, and stimulants will calm an ADHD brain but not a normal one. People who insist they've taken stuff like Ritalin or Concerta and aced their test are either full of it or actually do have a condition like ADHD but weren't diagnosed.
For the record, I have two close family members with ADHD and am intimately familiar with the drugs used to control it. I've seen first-hand the side effects, and how different drugs affect siblings completely differently. Different dosages have a dramatic effect as well, both on how well symptoms are controlled and how pronounced the side effects are (like emotional meltdowns after they wear off, and even worse problems with concentration and anxiety).
DON'T play with these drugs.